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 8203983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:44:51+00:00 2026-06-07T07:44:51+00:00

I am trying to create an event and store it in the default calendar

  • 0

I am trying to create an event and store it in the default calendar using this common piece of code:

EKEventStore *eventDB = [[EKEventStore alloc] init];
EKEvent *myEvent    = [EKEvent eventWithEventStore:eventDB];
myEvent.title       = titolo;
myEvent.startDate   = [NSDate date];
myEvent.calendar = [eventDB defaultCalendarForNewEvents];
myEvent.endDate     = data;
myEvent.allDay      = NO;
myEvent.notes       = note;

NSMutableArray *myAlarmsArray = [[NSMutableArray alloc] init];

EKAlarm *alarm1 = [EKAlarm alarmWithRelativeOffset:-300]; // 5 minutes
EKAlarm *alarm2 = [EKAlarm alarmWithRelativeOffset:-3600]; // 1 hour
EKAlarm *alarm3 = [EKAlarm alarmWithRelativeOffset:-86400]; // 1 day

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

myEvent.alarms = myAlarmsArray;
[myAlarmsArray release];

NSError *err;
[eventDB saveEvent:myEvent span:EKSpanThisEvent error:&err];
if (err == noErr) {
    return YES;
} else {
    [Utils logError:err];
    return NO;
}

It gives not a single problem in the simulator, but when running it on the physical device this will hang on indefinitely when I call [eventDB saveEvent:span:error:]. I tested in the simulator with iOS 4.2/4.3 and iOS 5.0.1, and on the real device I have iOS 5.0.1 installed.

What am I doing wrong here? Is it my fault or did I misconfigured the app somewhere?

Thank you.

Update

Here is the stack trace of the call when I pause the app via Xcode:

#0  0x3622a060 in semaphore_wait_trap ()
#1  0x36f55450 in _dispatch_thread_semaphore_wait$VARIANT$up ()
#2  0x36f536b4 in _dispatch_barrier_sync_f_slow ()
#3  0x36f53632 in dispatch_barrier_sync_f$VARIANT$up ()
#4  0x36f5328e in dispatch_sync_f$VARIANT$up ()
#5  0x36f53910 in dispatch_sync$VARIANT$up ()
#6  0x31b46628 in -[EKEventStore _deleteObject:] ()
#7  0x31b48f28 in -[EKPersistentObject primitiveRemoveRelatedObject:forKey:] ()
#8  0x31b43972 in -[EKPersistentEvent _adjustForNewCalendar] ()
#9  0x31b43490 in -[EKPersistentEvent validate:] ()
#10 0x31b708a2 in __23-[EKEventStore commit:]_block_invoke_0 ()
#11 0x36f537ea in _dispatch_barrier_sync_f_invoke ()
#12 0x36f5365a in dispatch_barrier_sync_f$VARIANT$up ()
#13 0x36f5328e in dispatch_sync_f$VARIANT$up ()
#14 0x36f53910 in dispatch_sync$VARIANT$up ()
#15 0x31b43200 in -[EKEventStore commit:] ()
#16 0x31b3f254 in -[EKEventStore saveEvent:span:commit:error:] ()
#17 0x31b3f11a in -[EKEventStore saveEvent:span:error:] ()
#18 0x00009018 in +[Utils creaEventoDaCalendario:note:data:] at /myPrivatePath/Utils.m:123
#19 0x0000c144 in -[PotenzialitaController(hidden) salvaEvento] ()
#20 0x34279434 in -[NSObject performSelector:withObject:withObject:] ()
#21 0x376e39ea in -[UIApplication sendAction:to:from:forEvent:] ()
#22 0x377a93ce in -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] ()
#23 0x34279434 in -[NSObject performSelector:withObject:withObject:] ()
#24 0x376e39ea in -[UIApplication sendAction:to:from:forEvent:] ()
#25 0x376e39a6 in -[UIApplication sendAction:toTarget:fromSender:forEvent:] ()
#26 0x376e3984 in -[UIControl sendAction:to:forEvent:] ()
#27 0x376e36f4 in -[UIControl(Internal) _sendActionsForEvents:withEvent:] ()
#28 0x376e402c in -[UIControl touchesEnded:withEvent:] ()
#29 0x376e250e in -[UIWindow _sendTouchesForEvent:] ()
#30 0x376e1f00 in -[UIWindow sendEvent:] ()
#31 0x376c84ec in -[UIApplication sendEvent:] ()
#32 0x376c7d2c in _UIApplicationHandleEvent ()
#33 0x30afadf2 in PurpleEventCallback ()
#34 0x342f3552 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#35 0x342f34f4 in __CFRunLoopDoSource1 ()
#36 0x342f2342 in __CFRunLoopRun ()
#37 0x342754dc in CFRunLoopRunSpecific ()
#38 0x342753a4 in CFRunLoopRunInMode ()
#39 0x30af9fcc in GSEventRunModal ()
#40 0x376f6742 in UIApplicationMain ()
#41 0x00002cbc in main at /myPrivatePath/main.m:14

At step #17 there is the call that hangs.

  • 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-06-07T07:44:53+00:00Added an answer on June 7, 2026 at 7:44 am

    This appears to be caused by a bug in iOS 5, and the app crashes when setting more than one alarm on an event. Everything works fine when using a single alarm.

    I did not try this on iOS 6, so I cannot tell you if Apple solved the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a simple event store using C# and [ServiceStack] Redis. public
I've been trying to create a generic event. Basically it should look like this:
I have a code like this where I am trying to add an event
I'm trying to retrieve a Google Calendar event using the Zend Gdata library. When
I am trying to create new Event objects to be persisted in the database
I'm trying to create an event through the Facebook Graph API and I keep
Im trying to create an ajax (post) event that will populate a table in
I have a database with event names and dates. I am trying to create
I'm trying to catch a double-click event in a TreeView's empty area to create
I'm trying to handle event after creating new record to ExtJS store and saving

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.