私のコードでは、ユーザーのリマインダーを取得してテーブルビューを表示しています。コードで NSLog を出力するたびに、テーブル配列が正しく表示されます。しかし、コードで NSLog を省略すると、データが正しく表示されなくなります。リマインダーの「タイトル」の値は (null) を返します。
毎回問題を再現できます。ここで何が起こっているのか誰にも分かりますか?
- (void)shareReminderButtonAction:(UIButton *)buttonEvent {
EKEventStore *store = [[EKEventStore alloc] init];
NSPredicate *predicate = [store predicateForRemindersInCalendars:nil];
[store requestAccessToEntityType:EKEntityTypeReminder completion:^(BOOL granted, NSError *error) {
[store fetchRemindersMatchingPredicate:predicate completion:^(NSArray *reminders) {
ReminderView *shareRem = [[ReminderView alloc]init];
NSLog(@"Reminders: %@", reminders);
UINavigationController *navigation = [[UINavigationController alloc] initWithRootViewController:shareRem];
[navigation setNavigationBarHidden:YES];
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:navigation animated:YES
completion:^(void){[shareRem setArray:reminders];}];
}];
}];
}
上記のコードで NSLog を使用してデータをログに記録します。
"EKReminder <0x1d5b3630> {title = Gdghv; dueDate = 2013-03-06 22:00:00 +0000; completionDate = (null); priority = 0; calendarItemIdentifier = 0BD2CB76-588B-4103-86B0-D71D22317DC0}"
上記のコードで NSLog なしでデータを受信すると、UITableViewController の終わりにデータをログに記録します。
CADObjectGetInlineStringProperty failed fetching title for EKPersistentReminder with error Error Domain=NSMachErrorDomain Code=268435459 "The operation couldn\342\200\231t be completed. (Mach error 268435459 - (ipc/send) invalid destination port)"
"EKReminder <0x1c5e6fd0> {title = (null); dueDate = (null); completionDate = (null); priority = 0; calendarItemIdentifier = (null)}"
どうもありがとう!