3
我想保存事件到iPhone日曆也刪除當用戶刪除事件。以下是我用於創建和編輯事件的代碼。EKEventEditViewActionDeleted調用幾次,同時刪除事件
// Upon selecting an event, create an EKEventViewController to display the event.
EKEventEditViewController *editController = [[EKEventEditViewController alloc] init];
editController.event = [eventsList objectAtIndex:indexPath.row];
editController.eventStore = self.eventStore;
editController.editViewDelegate = self;
itsSelectedReminder = indexPath.row;
isReminderDeleted = TRUE;
[editController.navigationBar setTintColor:[UIColor colorWithRed:67/255.0 green:114/255.0 blue:18/255.0 alpha:1]];
[self presentModalViewController:editController animated:YES];
[editController release];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
然後當用戶做任何動作添加,編輯或刪除我正在使用下面的代碼捕捉事件。
- (void)eventEditViewController:(EKEventEditViewController *)controller
didCompleteWithAction:(EKEventEditViewAction)action {
它適用於添加和編輯,但是當我試圖刪除它多次調用方法,使我的應用程序崩潰。任何幫助是極大的讚賞。請儘快提供幫助。
在此先感謝
問候,
迪利普...
在iOS 5.1中,我在刪除和保存時最多撥打4個電話。當我添加一個新的事件時,只需要1.檢查控制器的指針我發現,即使在相同的調用數組中,它的某些時候也是不同的。 –
你知道如何解決它..即使現在在我的應用程序是這樣的...我不知道它爲什麼這樣做... –
我只是在第一次調用時設置控制器editViewDelegate = nil。似乎工作。我再次用靜態分析儀和儀器檢查是否有泄漏,但沒有 –