How to create and save EKCalendar on ios 6

后端 未结 7 1238
自闭症患者
自闭症患者 2020-12-05 03:42

I\'m having an issue where I create my EKCalendar and everything looks good but then when I go to list my calendars, it doesn\'t show up. I also go to check my calendar list

7条回答
  •  醉话见心
    2020-12-05 03:52

    I found a solution. The problem is that when iCloud calendars switched on, it hides the locally created ones from the calendar app. To bypass this problem the solution is to add a new calendar to iCloud source:

        for (EKSource *source in self.eventStore.sources)
        {
            if (source.sourceType == EKSourceTypeCalDAV && 
               [source.title isEqualToString:@"iCloud"]) //Couldn't find better way, if there is, then tell me too. :)
            {
                localSource = source;
                break;
            }
        }
    
        if (localSource == nil)
        {
            for (EKSource *source in self.eventStore.sources)
            {
                if (source.sourceType == EKSourceTypeLocal)
                {
                    localSource = source;
                    break;
                }
            }
        }
    

提交回复
热议问题