Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS 6 app crashes when requesting access to calendar
    text
    copied!<p>It crashes at line:</p> <pre><code>eventStoreQueue = dispatch_queue_create("com.example.nativecalexample", NULL); </code></pre> <p>// Code</p> <pre><code>- (id)init { if ((self = [super init])) { eventStore = [[EKEventStore alloc] init]; if ([eventStore respondsToSelector:@selector(requestAccessToEntityType:completion:)]) { [eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) { events = [[NSMutableArray alloc] init]; items = [[NSMutableArray alloc] init]; eventStoreQueue = dispatch_queue_create("com.example.nativecalexample", NULL); [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(eventStoreChanged:) name:EKEventStoreChangedNotification object:nil]; }]; } } return self; } - (void)presentingDatesFrom:(NSDate *)fromDate to:(NSDate *)toDate delegate:(id&lt;KalDataSourceCallbacks&gt;)delegate { // asynchronous callback on the main thread [events removeAllObjects]; //NSLog(@"Fetching events from EventKit between %@ and %@ on a GCD-managed background thread...", fromDate, toDate); dispatch_async(eventStoreQueue, ^{ NSDate *fetchProfilerStart = [NSDate date]; NSPredicate *predicate = [eventStore predicateForEventsWithStartDate:fromDate endDate:toDate calendars:nil]; NSArray *matchedEvents = [eventStore eventsMatchingPredicate:predicate]; dispatch_async(dispatch_get_main_queue(), ^{ //NSLog(@"Fetched %d events in %f seconds", [matchedEvents count], -1.f * [fetchProfilerStart timeIntervalSinceNow]); [events addObjectsFromArray:matchedEvents]; [delegate loadedDataSource:self]; }); }); } </code></pre> <p>EDIT: I get EXC_BAD_ACCESS at that line when the app crashes, screenshot: <a href="http://i45.tinypic.com/2kzeu.png" rel="nofollow">http://i45.tinypic.com/2kzeu.png</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload