简体   繁体   中英

iphone app with add to calendar

i'm creating an iphone application which can add events into local iphone calendar.

i have implemented a process here the source

EKEventStore *eventStore = [[EKEventStore alloc] init];
EKEvent *event = [EKEvent eventWithEventStore:eventStore];
event.startDate = [[NSDate alloc] init];
event.endDate = [[NSDate alloc] initWithTimeInterval:600 sinceDate:event.startDate];
[event setCalendar:[eventStore defaultCalendarForNewEvents]];
NSError *err;
[eventStore saveEvent:event span:EKSpanThisEvent error:&err]; 

the problem with this is it doesnt show the iphone new event add screen. which can change the time of the event . is thr any way to do this.

And this is correct since you create the the MKEvent programmatically.

If you lookup EventKitUI this has clases that will allow you to present the user with default Event creation view controllers. Like the EKEventViewController

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM