如何在ios 5应用程序中添加ipodical中的事件?

时间:2011-10-26 05:53:19

标签: iphone

我正在使用EKEventStore将我的应用程序中的事件添加到iphone日历中,它适用于ios版本4.2的设备,并且从我的应用程序中将事件完美地添加到ical中但是当我在ipod中安装相同的应用程序时ios版本5,奇怪的是事件没有添加到ical中,这是我添加事件的功能,

    -(void)icall_add{


 //daily_trackAppDelegate *controller2 =(daily_trackAppDelegate *) [[UIApplication sharedApplication] delegate];
    EKEventStore *eventStore = [[EKEventStore alloc] init];

    EKEvent *event  = [EKEvent eventWithEventStore:eventStore];
    event.title     = text2.text;
    //event.attendees = controller2.who;
    event.notes= text3.text;


    //controller2.new_event_title = @"";
    //controller2.new_recent_location = @"";


    event.startDate = mydatepicker.date;
    //event.endDate   = [[NSDate alloc] initWithTimeInterval:3600 sinceDate:event.startDate];
    event.endDate = mydatepicker.date;

    [event setCalendar:[eventStore defaultCalendarForNewEvents]];
    NSError *err;
    [eventStore saveEvent:event span:EKSpanThisEvent error:&err];  
    daily_trackAppDelegate *controller2 =(daily_trackAppDelegate *) [[UIApplication sharedApplication] delegate];

    text1.text = @"";
    text2.text = @"";
    text3.text = @"";
    controller2.who = @"";
    controller2.new_event_title = @"";
    controller2.new_recent_location = @"";



}

请指导那个问题如何解决它,提前知道,问候Saad。

1 个答案:

答案 0 :(得分:1)

轻松修复,只需转到设置> iCloud>打开日历 问题固定!!