ios - time issue in writing event in iPhone Calendar -


I want to write an event in the default calendar of iPhone but I'm facing a problem in time, I started Date 18-02-2014 08:00 PM and end date 25-02-2014 11:30 PM I am using the code. But writing this start date is 18-02-2014 12:00 pm and the end date is 25-02-2014 12:30 pm.I do not know where I am wrong. How can I write it at the same time?

  - (zero) writeEventwithTitle: (NSString *) aTitle startDate: (NSDate *) strtDate endDate: (NSDT *) Ndateate {_eventStore = [[EKESTSTOR ALLOW] INIT]; [_eventStore requestAccessToEntityType: EKEntityTypeEvent termination: ^ (BOOL sanctioned, NSError * error) {If (cleared!) {Return; } EKEvent * event = [EventStore: EeventStore] with EKEvent Event; Event.title = aTitle; Event.startDate = strtDate; Event.endDate = ndDate; [Event Set calendar: [_destore default default calendarfourNewEvents]]; NSError * err; [_eventStore saveEvent: Event Span: EKSpanFutureEvents commit: Yes Error: & amp; Err]; }]; } - (zero) startWritingEvent {for (int i = 0; i & lt; [_eventArray count]; i ++) {id dict = [_eventArray object endx: i]; NSString * eventTitle = [dict item: title]; NSDictionary * eventBeginArray = [dict itemForks: eventbase]; NSDT * StartDate = [Auto DateFormat: [EventBaganArray ObjectForcae: Start-Date] and Time: [EventbagnerErereformForKorky: Starttime]]; NSDate * endDate = [Self DateFormat: [EventbaganArray ObjectForky: Endadet] and Time: [EventbaganArere Objectwork: Endtime]]; [Self writing Event Details Title: eventTitle startDate: startDate endDate: endDate]; }} - (NSDate *) dateFromDate: (NSString *) Date and time: (NSString *) time {NSString * eventDttm = [[NSString alloc] init]; EventDttm = [NSString stringWithFormat: @ "% @% @", date, time]; NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init]; [DateFormatter setDateFormat: @ "dd-MM-yyyy HH: mm one"]; [Dateformer settimezone: [annemmezone system timezone]]; // NSSTing NSDate conversion of NSDate * dateFromString = [[NSDate alloc] init]; DateFromString = [dateFormatter dateFromString: eventDttm]; Return Date Framestrings; }  


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -