4

Can anyone have any idea about programmatically add reminder to iPhone calendar.

I searched the iPhone SDK documentation but didn't find anything.

Thanks and Regards Jayaraj

4 Answers 4

1

This functionality is available in iOS 4.x with EventKit.

1

You could try to read this EventKit sample.

1

Oh yes you can...

    #import <EventKit/EventKit.h>

...

    EKEventStore *eventDB = [[EKEventStore alloc] init];
    EKEvent *myEvent  = [EKEvent eventWithEventStore:eventDB];

    myEvent.title     = @"New Event";
    myEvent.startDate = [[NSDate alloc] init];
    myEvent.endDate   = [[NSDate alloc] init];
    myEvent.allDay = NO;
    myEvent.notes = @"Test";

    [myEvent setCalendar:[eventDB defaultCalendarForNewEvents]];

    NSError *err;

    [eventDB saveEvent:myEvent span:EKSpanThisEvent error:&err]; 

    if (err == noErr) {
       UIAlertView *alert = [[UIAlertView alloc]
                initWithTitle:@"Event Created"
                message:@"Yay!?"
                delegate:nil
                cancelButtonTitle:@"Okay"
                otherButtonTitles:nil];
       [alert show];
       [alert release];
    }
-1

You can't. If you need this functionality you should file a bug with Apple explaining why you need it.

1
  • This answer is outdated, consider removing.
    – Lolloz89
    Sep 27, 2013 at 10:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.