Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>At last i Found the solution for the error .The Code is below</p> <p>-(IBAction)notifyButtonpressed:(id)sender { NSLog(@"notify button pressed");</p> <pre><code>EKEventStore *eventStore = [[EKEventStore alloc] init]; EKEvent *event = [EKEvent eventWithEventStore:eventStore]; event.title=location; //startdate--format---November 19 2011 9:30 PM NSDateFormatter *dateformatter=[[NSDateFormatter alloc]init]; NSDate *date=[NSDate date]; [dateformatter setDateFormat:@"Z"]; NSString *timezones=[dateformatter stringFromDate:date]; NSLog(@"time zone is %@",timezones); NSMutableString *new_start=[[NSMutableString alloc]init]; [new_start appendString:[NSString stringWithFormat:@"%@ %@",startdate,timezones]]; NSLog(@"after0000-----append is %@",new_start); [dateformatter setDateFormat:@"MMMM dd yyyy hh:mm a Z"]; NSLog(@"start date is %@",startdate); NSDate *startdates = [dateformatter dateFromString:new_start]; NSMutableString *new_start1=[[NSMutableString alloc]init]; [new_start1 appendString:[NSString stringWithFormat:@"%@ %@",enddate,timezones]]; NSDate *enddates=[dateformatter dateFromString:new_start1]; NSLog(@"-------date is %@ ,%@------",startdates,new_start1); event.title=Title; NSLog(@"start date is %@--",startdates); event.startDate =[startdates initWithTimeInterval:600 sinceDate:startdates]; event.endDate=enddates; [event setCalendar:[eventStore defaultCalendarForNewEvents]]; NSLog(@"event start date is %@ and enddate is %@",event.startDate,event.endDate); NSError *err; [eventStore saveEvent:event span:EKSpanThisEvent error:&amp;err]; if(!err) { UIAlertView *alertview=[[UIAlertView alloc]initWithTitle:Title message:@"Event Added successfully " delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertview show]; [alertview release]; } NSLog(@"error is %@",err); </code></pre> <p>}</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload