我有UITableViewController
使用此代码推送EKEventViewController
选择行:
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
if([segue.identifier isEqualToString:@"eventHandler"]){
if (_currentPanel.event_identifier != nil) {
self.event = [[[CalendarHelper sharedInstance] store] eventWithIdentifier:_currentPanel.event_identifier];
} else {
EKEventStore *store = [[CalendarHelper sharedInstance] store];
self.event = [EKEvent eventWithEventStore:store];
_event.startDate = self.qualifyDate;
_event.endDate = self.qualifyDate;
_event.title = @"test identifier" ;
_event.calendar = [[CalendarHelper sharedInstance] calendar];
}
self.eventDatailController = (EKEventViewController *)[segue destinationViewController];
self.eventDatailController.event = self.event;
self.eventDatailController.allowsEditing = YES;
self.eventDatailController.allowsCalendarPreview = YES;
self.eventDatailController.delegate = self;
}
}
事件显示效果很好,但在通过“编辑”按钮在EKEventViewController
中编辑了该事件并完成点击“完成”按钮后,EKEventViewController
中的事件未相应刷新。
SimpleEKDemo
工作正常但不使用
prepareForSegue:sender:
但是
tableView:didSelectRowAtIndexPath:
我做错了什么?
答案 0 :(得分:0)
您只需执行以下操作即可从didSelectRowAtIndexPath调用prepareForSegue方法:
[self prepareForSegue:@"EKEventViewController" sender:self];