iPhone - How to import native calendar events to my iphone app?

Posted by sachi on Stack Overflow See other posts from Stack Overflow or by sachi
Published on 2012-09-11T08:50:41Z Indexed on 2012/09/11 9:38 UTC
Read the original article Hit count: 209

Filed under:
|

I am doing one simple application using iPhone calendar, where I need to import the iPhone native calendar events into my iPhone app. How can I do this. I have a piece of code but it doesn't seems to be working. I have added some events into my iPhone native calendar. But when i retrieve it's not fetching anything. Here is the piece of code.

-(IBAction)importCalEvents:(id)sender
{
    NSArray *caleandarsArray = [[NSArray alloc] init];
    caleandarsArray = [[eventStore calendars] retain]; 
    NSLog(@"Calendars from Array : %@", caleandarsArray);

for (EKCalendar *CalendarEK in caleandarsArray) 
 {
    NSLog(@"Calendar Title : %@", CalendarEK.title);    
 }        
}

© Stack Overflow or respective owner

Related posts about iphone

Related posts about calendar