Skip to content

Instantly share code, notes, and snippets.

@segphault
Created February 4, 2012 23:56
Show Gist options
  • Save segphault/1741224 to your computer and use it in GitHub Desktop.
Save segphault/1741224 to your computer and use it in GitHub Desktop.
CalendarStore task in MacRuby
framework "calendarstore"
store = CalCalendarStore.defaultCalendarStore
pred = CalCalendarStore.taskPredicateWithCalendars(store.calendars)
reminders = store.calendars.find {|c| c.title == "Reminders"}
newTask = CalTask.alloc.init
newTask.title = "This is a test"
newTask.calendar = reminders
err = Pointer.new_with_type("@")
store.saveTask(newTask, error:err)
store.tasksWithPredicate(pred).each {|x| puts x.title }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment