Ios 仅当存在单个日历帐户时才出现EKCalendarChooser问题

Ios 仅当存在单个日历帐户时才出现EKCalendarChooser问题,ios,objective-c,eventkit,Ios,Objective C,Eventkit,我正在使用iOS 7.1并执行以下操作,以便使用EventKit向用户显示可写日历: EKEventStore *eventStore = [[EKEventStore alloc] init]; EKCalendarChooser *calendarChooser = [[EKCalendarChooser alloc] initWithSelectionStyle:EKCalendarChooserSelectionStyleMultiple displayStyle: EKCalendar

我正在使用iOS 7.1并执行以下操作,以便使用EventKit向用户显示可写日历:

EKEventStore *eventStore = [[EKEventStore alloc] init];
EKCalendarChooser *calendarChooser = [[EKCalendarChooser alloc] initWithSelectionStyle:EKCalendarChooserSelectionStyleMultiple displayStyle: EKCalendarChooserDisplayWritableCalendarsOnly eventStore:eventStore];
[self.navigationController pushViewController:calendarChooser animated:YES];
我注意到只有在对单个日历帐户进行测试时才会出现两种非常奇怪的行为:

  • 轻敲附件(在下面的屏幕中突出显示)总是会导致应用程序崩溃。
  • 如果帐户包含N个可写日历,则仅显示N-1个日历。在上面的屏幕截图中,由于某种原因,没有显示与此iCloud帐户关联的第二个可写日历(称为“工作”)
  • 上面的示例使用iCloud,但我也针对Exchange/Outlook帐户测试了此问题,并得到了类似的结果

    我的代码中是否有遗漏?其他开发人员有类似的经历吗?

    我也有同样的问题。 经过多次“反复试验”我发现, 该EKCalendarChooser必须是UINavigationController的根视图控制器:

    EKEventStore *eventStore = [[EKEventStore alloc] init]; 
    EKCalendarChooser *calendarChooser = [[EKCalendarChooser alloc] initWithSelectionStyle:EKCalendarChooserSelectionStyleMultiple displayStyle: EKCalendarChooserDisplayWritableCalendarsOnly eventStore:eventStore]; 
    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController: calendarChooser]; 
    
    这应该行得通。我在iPad上用了一个popover控制器,但用另一个UINavigationController也可以


    @苹果:请更新文档以避免此类问题

    您能发布崩溃信息吗?谢谢您的回复。不幸的是,我似乎无法在iOS 7.1.2中重新创建该问题。也许它已经修复了?我把EKCalendarChooser直接放进了PopupController,它是IOS8测试版,所以可能这也是一个重新引入的bug。