segue和EKEventViewController刷新

时间:2012-11-16 00:50:24

标签: objective-c uitableview storyboard

我有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:

我做错了什么?

1 个答案:

答案 0 :(得分:0)

您只需执行以下操作即可从didSelectRowAtIndexPath调用prepareForSegue方法:

[self prepareForSegue:@"EKEventViewController" sender:self];