Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.53 KB | None | 0 0
  1. Last Exception Backtrace:
  2. 0 CoreFoundation 0x18625e950 __exceptionPreprocess + 132
  3. 1 libobjc.A.dylib 0x1927641fc objc_exception_throw + 60
  4. 2 CoreFoundation 0x18625e810 +[NSException raise:format:arguments:] + 116
  5. 3 Foundation 0x186d96db4 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112
  6. 4 EventKit 0x186adab84 -[EKEventStore _addFetchedObjectWithID:] + 240
  7. 5 EventKit 0x186adaa64 __78-[EKEventStore registerFetchedObjectWithID:withDefaultLoadedProperties:inSet:]_block_invoke + 96
  8. 6 libdispatch.dylib 0x192d3bfd4 _dispatch_client_callout + 16
  9. 7 libdispatch.dylib 0x192d41c84 _dispatch_barrier_sync_f_invoke + 48
  10. 8 EventKit 0x186ada990 -[EKEventStore registerFetchedObjectWithID:withDefaultLoadedProperties:inSet:] + 148
  11. 9 EventKit 0x186ae1458 __41-[EKPredicateSearch startWithCompletion:]_block_invoke + 796
  12. 10 EventKit 0x186ae1050 -[EKDaemonConnection _processReplyWithID:data:finished:] + 220
  13. 11 EventKit 0x186ae0f5c CADReceiveReply + 136
  14. 12 EventKit 0x186ae0eac _XReply + 124
  15. 13 EventKit 0x186ae0e04 ClientCallbacks_server + 100
  16. 14 libdispatch.dylib 0x192d3fae8 dispatch_mig_server + 352
  17. 15 EventKit 0x186ae0d6c __43-[EKDaemonConnection initWithOptions:path:]_block_invoke16 + 44
  18. 16 libdispatch.dylib 0x192d3bfd4 _dispatch_client_callout + 16
  19. 17 libdispatch.dylib 0x192d3db90 _dispatch_source_invoke + 500
  20. 18 libdispatch.dylib 0x192d430f4 _dispatch_root_queue_drain + 104
  21. 19 libdispatch.dylib 0x192d434fc _dispatch_worker_thread2 + 76
  22. 20 libsystem_pthread.dylib 0x192ed16bc _pthread_wqthread + 356
  23. 21 libsystem_pthread.dylib 0x192ed154c start_wqthread + 4
  24.  
  25. + (EKEventStore *) sharedStore {
  26. static EKEventStore *sharedEventStore;
  27.  
  28. if (sharedEventStore == nil) {
  29. sharedEventStore = [[EKEventStore alloc] init];
  30. [sharedEventStore requestAccessToEntityType: EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {
  31. }];
  32. [sharedEventStore reset];
  33. }
  34.  
  35. return sharedEventStore;
  36. }
  37.  
  38. NSPredicate *predicate = [[CalendarHelper sharedStore] predicateForEventsWithStartDate:startDate
  39. endDate:endDate
  40. calendars:[[showableCalendars copy] autorelease]];
  41. NSArray *result = [[CalendarHelper sharedStore] eventsMatchingPredicate:predicate];
  42.  
  43. EKEvent *event = [[CalendarHelper sharedStore] eventWithIdentifier:eventId];
  44. if(event != nil) {
  45. event.title = title;
  46. event.startDate = startDate;
  47. event.endDate = endDate;
  48. NSLog(@"Updating...");
  49. NSLog(@"+++ %@", event.eventIdentifier);
  50.  
  51. [[CalendarHelper sharedStore] saveEvent:event span:EKSpanThisEvent commit:commit error:nil];
  52. NSLog(@"Updated.");
  53. }
  54. else {
  55. NSLog(@"No event, no update");
  56. }
  57.  
  58. NSPredicate *predicate = [self.eventStore predicateForEventsWithStartDate:startDate endDate:endDate calendars:nil];
  59.  
  60. if (!self.masterListSortDescriptor)
  61. {
  62. self.masterListSortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"startDate" ascending:YES];
  63. }
  64.  
  65. NSArray *result = [[self.eventStore eventsMatchingPredicate:predicate]
  66. sortedArrayUsingDescriptors:@[self.masterListSortDescriptor]];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement