我有一个EKCalendarChoosere
允许我选择日历的。我看到日历和委托方法 ( EKCalendarChooserDelegate
) 被调用。但是,当我访问日历选择器的选定日历属性时,它们始终为空。需要手动添加它们还是选择器处理?提前致谢
2 回答
如果您仍然对为什么calendarChooserSelectionDidChange方法为selectedCalendars返回 NULL 结果感兴趣。我遇到了同样的问题。
当调用calendarChooserSelectionDidChange委托方法时,如果 使用EKCalendarChooserSelectionStyleSingle设置了EKCalendarChooser ,则一切正常。但是,如果它是为EKCalendarChooserSelectionStyleMultiple设置的,则calendarChooserSelectionDidChange委托方法会触发,但calendarChooser.selectedCalendars将返回 NULL,除非您在设置 EKCalendarChooser 时设置日历的 NSSet,即: detailViewController.selectedCalendars = mySelectedCalendars; 或 detailViewController.selectedCalendars = [NSSet setWithArray:[eventStore calendars]];
似乎没有必要填充NSSet
,只需分配初始化它(在EKCalendarChooser
's中viewDidLoad
):EKCalendarChooser 多重选择不起作用