当我从日历,数组和数据库中删除事件时,我的应用程序崩溃了,该对象将从日历和数据库中删除,但在删除它之后,应用程序有时并不总是崩溃。有一个代码,提交编辑样式是函数名。
Container *mykids = (Container*)[appDelegate.array1 objectAtIndex:indexPath.row];
appDelegate.actionId = mykids.Id;
//delete from calender
EKEventStore* store = [[EKEventStore alloc] init];
EKEvent* event2 = [store eventWithIdentifier:mykids.Event];
if (event2 != nil) {
NSError* error = nil;
[store removeEvent:event2 span:EKSpanThisEvent error:&error];
}
[store release];
//delete end
[mykids deleteAction];
[appDelegate.array1 removeObjectAtIndex:indexPath.row];
//Delete the object from the table.
[localTable deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
[localTable reloadData];
收到信号:“EXC_BAD_ACCESS”
。 (这是最后一条消息)