EKEventstore crash when accessing from different controllers

I am new here, but I read a lot. Most of all I found what I was looking for, but now I'm stuck. Reading the documentation and google request did not help me here:

I have an application that adds events to a user's calendar using EKEventstore. I used all of this from one view controller, including a function to select one of the user calendars. I created eventstores several times in the code, and everything worked fine.

Now I have upgraded my application to more professional coding, including several view controllers. One of them is handled by the calendar collector (a simple view of the table lists all the calendars), the other is the creation and saving of new events in the calendar.

EKEvenstore announced in appdelegate.h

EKEventStore *es; 

Each view controller defines an evenststore method in it viewWillAppear:

 es=[[EKEventStore alloc]init]; 

Everything works fine, I can load safe events from and to the eventstore, but as soon as I switch to the calendar selection view controller (just load it) and then return to the view controller that creates the events, the application crashes. After a new launch, everything is in order. Any idea is much appreciated.

Here is my stack after throw throw exception:

2011-08-25 15: 35: 18.795 Dutysheet Wx [13864: 707] - [UINavigationButton refresh]: unrecognized selector sent to instance 0x688f0a0 2011-08-25 15: 35: 18.822 Dutysheet Wx [13864: 707] * Application termination from due to the uncaught exception "NSInvalidArgumentException", reason: '- [Update UINavigationButton]: unrecognized selector sent to instance 0x688f0a0' * Call stack on first throw: (0 CoreFoundation 0x30b1364f exceptionPreprocess + 114 1 libobjc.A.dylib obx34ececec_exec_ec_6262ecxecec_ec_ec2 CoreFoundation 0x30b171bf - [NSObject (NSObject) doesNotRecognizeSelector:] + 102 3 CoreFoundation 0x30b16649 __forwarding + 508 4 CoreFoundation 0x30a8d180 _CF_forwarding_prep_0 + 48 5 EventKit 0x339bbbbb1fbbb1fb1bfb1bfb1bfb1fb1bfb1fb1bfb1fb1fb1fb1bf1bfb1fb1bf1bf1bf1bf1bfb1bf1bf1bfb1bf1bfb1bf1bfb1fb1bf1bf1bf1bfb1fb1fb1fb1fb1fbf1bfb1bfb1fb1fb1fbf1 aseChanged + July 18 CoreFoundation 0x30ae2d69 CFNotificationCenterDarwinCallBack + August 24 CoreFoundation 0x30adfbdf __CFMachPortPerform + 210 9 CoreFoundation 0x30aeaa97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + October 26 CoreFoundation 0x30aec83f __CFRunLoopDoSource1 + 166 11 CoreFoundation 0x30aed60d __CFRunLoopRun + 520 12 CoreFoundation 0x30a7dec3 CFRunLoopRunSpecific + 230 13 CoreFoundation 0x30a7ddcb CFRunLoopRunInMode + 58 14 GrafikaUslugi 0x303fc41f GSEventRunModal + 114 15 GraphicsServices 0x303fc4cb GSEventRun + 62 16 UIKit 0x30ba3d69 - [UIApplication _run] + 404 17 UIKit 0x30ba1807 UIApplicationMain + 670 18 Dutysheet Wx 0x00002a83 main + 82 19 Dutysheet Wx 0x000029frite 'call + initial' record + callback

+4
source share

Source: https://habr.com/ru/post/1368964/


All Articles