Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6126963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:26:39+00:00 2026-05-23T16:26:39+00:00

The following is my code NSLog(@%@, thisEvent1.title); EKEvent *thisEvent = [EKEvent eventWithEventStore:eventStore]; eventStore =

  • 0

The following is my code

NSLog(@"%@", thisEvent1.title); 

EKEvent *thisEvent  = [EKEvent eventWithEventStore:eventStore];

eventStore = [[EKEventStore alloc] init];

thisEvent = [EKEvent eventWithEventStore:eventStore];


NSDateFormatter *   dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd:HH:mm"];


NSDate * date = [[NSDate alloc] init];
date = [dateFormatter dateFromString:[itsStartDate objectAtIndex:indexPath.row]];
[date retain];

thisEvent.startDate = [dateFormatter dateFromString:[itsStartDate objectAtIndex:indexPath.row]];
thisEvent.endDate = [dateFormatter dateFromString:[itsEndDate objectAtIndex:indexPath.row]];
thisEvent.notes = [itsNotes objectAtIndex:indexPath.row];
thisEvent.title = [itsTitle objectAtIndex:indexPath.row];
thisEvent.location = [itsLocation objectAtIndex:indexPath.row];
// thisEvent.allDay = TRUE;
NSMutableArray *myAlarmsArray = [[NSMutableArray alloc] init];

EKAlarm *alarm1 = [EKAlarm alarmWithRelativeOffset:-[[itsAlertOne objectAtIndex:indexPath.row] intValue]]; // 1 Hour
// EKAlarm *alarm2 = [EKAlarm alarmWithRelativeOffset:-86400]; // 1 Day

[myAlarmsArray addObject:alarm1];
//[myAlarmsArray addObject:alarm2];

thisEvent.alarms = myAlarmsArray;
[myAlarmsArray release];

//setting the Reuccurence rule

NSString * test1 = [itsRecurrenceFrequency objectAtIndex:indexPath.row];

    BOOL isRecurrenceFrequencyExists = TRUE;

EKRecurrenceFrequency  recurrenceFrequency;

if ([test1 isEqualToString: @"EKRecurrenceFrequencyDaily"]) {
    recurrenceFrequency = EKRecurrenceFrequencyDaily;
}else if([test1 isEqualToString: @"EKRecurrenceFrequencyWeekly"]){
    recurrenceFrequency = EKRecurrenceFrequencyWeekly;
}else if([test1 isEqualToString: @"EKRecurrenceFrequencyMonthly"]){
    recurrenceFrequency = EKRecurrenceFrequencyMonthly;
}else if([test1 isEqualToString: @"EKRecurrenceFrequencyYearly"]){
    recurrenceFrequency = EKRecurrenceFrequencyYearly;
}else{
    isRecurrenceFrequencyExists = FALSE;
}

    if(isRecurrenceFrequencyExists){
        EKRecurrenceRule * recurrenceRule = [[EKRecurrenceRule alloc] 

                                     initRecurrenceWithFrequency:recurrenceFrequency
                                     interval:[[itsRecurrenceInterval objectAtIndex:indexPath.row]intValue]
                                     end:nil];
        if (thisEvent.endDate != nil) {
            EKRecurrenceEnd * end = [EKRecurrenceEnd recurrenceEndWithEndDate:thisEvent.endDate];
            recurrenceRule.recurrenceEnd = end;
        }else {
            thisEvent.endDate = thisEvent.startDate;
        }

        thisEvent.recurrenceRule = recurrenceRule;
        [recurrenceRule release];

    }
[thisEvent setCalendar:[eventStore defaultCalendarForNewEvents]];
NSError *err;


[eventStore saveEvent:thisEvent span:EKSpanFutureEvents error:&err]; 
NSLog(@"%@", thisEvent.eventIdentifier);
[self.eventsList addObject:thisEvent];

In this code I have the Event id of my calendar event.

  1. Now I want to update the event with the changes however Its not updating the previously created event.

  2. Second I Need to know is it possible to capture the changes in calendar event they made in iPhone Calendar including deleting an event.

  3. Can we delete the calendar event using the eventid?

Please help me if any one know the answer.. Thank you in advance.

Regards,
Dilip Rajkumar

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:26:39+00:00Added an answer on May 23, 2026 at 4:26 pm

    Event can be created by this:

    [eventStore saveEvent:event span:EKSpanThisEvent error:&err]; 
       NSString* str = [[NSString alloc] initWithFormat:@"%@", event.eventIdentifier];
    [arrayofCalIDs addObject:str];
    

    You can delete the event using this:

    EKEventStore* store = [[[EKEventStore alloc] init] autorelease];
       EKEvent* event2 = [store eventWithIdentifier:[arrayofCalIDs objectAtIndex:i]];
    if (event2 != nil) {  
      NSError* error = nil;
      [store removeEvent:event2 span:EKSpanThisEvent error:&error];
    } 
    [myPath release];
    
    For Updating Event you cannot directly access any method as it is not available in iOS. So, you can do one thing for this. 
    (1) First remove the event with eventID.
    (2) Create new Event using the same information of the last deleted event.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I use the following code: NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@yyyy-MM-dd'T'HH:mm];
i have the following code... DistanceInformation *distanceInformation=[[DistanceInformation alloc]init]; NSArray *latLongArray=[distanceInformation calculateDistance]; [distanceInformation release]; NSLog(@lat
I have a following code: NSLog(@%d, [chart retainCount]); self.chart = [[BNPieChart alloc] initWithFrame:self.view.frame]; NSLog(@%d,
Based on the following code, please advise NSString *str= [[NSString alloc] initWithString:@Hello world]; NSLog(@Length:
I have the following code: UIImageView * imgView = [[UIImageView alloc] initWithImage:image]; NSLog(@IMAGE SIZE
I have the following code: NSLog(@items: %d, [items count]); NSLog(@allObjects: %d, [self.allObjects count]); [self.allObjects
I have the following code in my applicationWillTerminate in the app delegate: NSLog(@Source: %d,
I have the following code in place: NSString *mapIDx = @98; NSLog(@map id: %@,
I have the following code: self.itemsCopy = [self.items mutableCopy]; //[self.itemsCopy addObjectsFromArray:self.items]; NSLog(@------- BEFORE APPEND
The following code snippet: NSLog(@userInfo: The timer is %d, timerCounter); NSDictionary *dict = [NSDictionary

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.