0
在我的代码中我正在检索用户提醒并显示它们的tableview。 每当我在代码中打印NSLog时,表格数组得到正确显示。但是每当我在代码中遗漏了NSLog,我的数据就不能正确显示了。提醒“title”的值返回(null)。奇怪的数据解析问题
我可以每次重现该问题。任何人都知道这里发生了什么?在上面的代码才能使用的NSLog
- (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];}];
}];
}];
}
日志数据:在的UITableViewController结束
"EKReminder <0x1d5b3630> {title = Gdghv; dueDate = 2013-03-06 22:00:00 +0000; completionDate = (null); priority = 0; calendarItemIdentifier = 0BD2CB76-588B-4103-86B0-D71D22317DC0}"
日志数据在我的代码没有NSLog的接收上述数据时:
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)}"
非常感谢!
您使用不适当的标签*仅*恭喜... – 2013-02-28 22:58:17
我发现我是有这个问题。 EKEventStore很快就会释放。我把它放在我的viewDidLoad方法中,一切都很好! – freshking 2013-03-01 09:25:09