阅读背景:

如何获得iCloud的EKSource?

来源:互联网 

Trying to implement iCloud Calendar synchronization for iOS.

尝试为iOS实现iCloud Calendar同步。

Need to get corresponding EKSource object to be able to create calendar there. While iterating over the stores the type for iCloud store is EKSourceTypeCalDAV but the same type can be used for other stores as well.

需要获得相应的EKSource对象才能在那里创建日历。迭代商店时,iCloud商店的类型是EKSourceTypeCalDAV,但同样的类型也可以用于其他商店。

So how can I specify if corresponding store is really for iCloud?

那么如何指定相应的商店是否真的适用于iCloud?

Right now using description text but it's not a right solution:

现在使用描述文本,但它不是一个正确的解决方案:

for (EKSource *source in store.sources) {
    if (source.sourceType == EKSourceTypeCalDAV) {
        if([source.title isEqualToString:@"iCloud"]) {
            caldavSource = source;
            break;
        } 
    }
}

1 个解决方案

#1


1  

This is the way that how i create calendar on iCloud

这就是我如何在iCloud上创建日历的方式

EKSource* localSource=nil;

for (EKSource* source in self.eventStore.sources)
{
    if(source.sourceType == EKSourceTypeCalDAV && [source.title isEqualToString:@"iCloud"])
    {
        localSource = source;
        break;
    }

}

分享到: