Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 将命名和订阅的日历导入应用程序并显示所有事件_Ios_Objective C_Iphone_Xcode_Icalendar - Fatal编程技术网

Ios 将命名和订阅的日历导入应用程序并显示所有事件

Ios 将命名和订阅的日历导入应用程序并显示所有事件,ios,objective-c,iphone,xcode,icalendar,Ios,Objective C,Iphone,Xcode,Icalendar,所以基本上,我在尝试制作一个应用程序时遇到了麻烦 目标是从iCal导入一个特定的订阅日历,并将所有事件放入一个数组中 我设法请求访问日历。 我成功地导入了所有日历,并使用 NSArray *allCalendars = [self.eventStore calendarsForEntityType:EKEntityTypeEvent]; NSMutableArray *localCalendars = [[NSMutableArray alloc] init]; for (int i=0; i

所以基本上,我在尝试制作一个应用程序时遇到了麻烦

目标是从iCal导入一个特定的订阅日历,并将所有事件放入一个数组中

我设法请求访问日历。 我成功地导入了所有日历,并使用

NSArray *allCalendars = [self.eventStore calendarsForEntityType:EKEntityTypeEvent];
NSMutableArray *localCalendars = [[NSMutableArray alloc] init];

for (int i=0; i<allCalendars.count; i++) {
    EKCalendar *currentCalendar = [allCalendars objectAtIndex:i];
    if (currentCalendar.type == EKCalendarTypeSubscription) {
        NSLog(@"%@", currentCalendar);
NSArray*allCalendars=[self.eventStore calendarsForEntityType:eEntityTypeEvent];
NSMutableArray*localCalendars=[[NSMutableArray alloc]init];

对于(inti=0;i您可以使用title属性并检查title=@“大日历”,然后导入它

for (int i=0; i<allCalendars.count; i++) {
    EKCalendar *currentCalendar = [allCalendars objectAtIndex:i];
    if (currentCalendar.type == EKCalendarTypeSubscription && currentCalendar.title == @"Big Calendar") {
        NSLog(@"%@", currentCalendar);

for(int i=0;iNo luck,我想这是因为在我想要的日历上allowsModify=NO。有办法解决这个问题吗?