Crash on private UIAlertView method

I see a strange glitch in one of my apps that seems to come from a private method in the UIAlertView. I searched a bit and found several other references to this method involved in crashes like the one here , but I'm not sure if the reason is the same. However, to be sure that I always set the UIAlertView delegate to zero whenever the delegate is released.

The stack trace looks like this:

Exception Type:  SIGABRT
Exception Codes: #0 at 0x351ce32c
Crashed Thread:  0

Thread 0 Crashed:
0   libsystem_kernel.dylib              0x351ce32c __pthread_kill + 8
1   libsystem_c.dylib                   0x370c329f abort + 95
2   eLogbook                            0x000bbacd -[GetOperationPartsDictionary init] (GetOperationPartsDictionary.m:22)
3   UIKit                               0x32557f93 -[UIAlertView(Private) _popoutAnimationDidStop:finished:] + 855
4   UIKit                               0x3240dc53 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 471
5   UIKit                               0x3241357d -[UIViewAnimationState animationDidStop:finished:] + 53
6   QuartzCore                          0x36eeac2f CA::Layer::run_animation_callbacks(void*) + 203
7   libdispatch.dylib                   0x3140ae91 _dispatch_main_queue_callback_4CF$VARIANT$up + 197
8   CoreFoundation                      0x353ad2ad __CFRunLoopRun + 1269
9   CoreFoundation                      0x353304a5 CFRunLoopRunSpecific + 301
10  CoreFoundation                      0x3533036d CFRunLoopRunInMode + 105
11  GraphicsServices                    0x3662c439 GSEventRunModal + 137
12  UIKit                               0x32426e7d UIApplicationMain + 1081
13  eLogbook                            0x0007767f main (main.m:14)


What is really confusing me is that the method -[UIAlertView(Private) _popoutAnimationDidStop:finished:]

calls the init method call in my GetOperationPartsDictionary class. From the limited amount of information I have received from users, this crash occurs on startup, at which point this class would not be loaded.

I am using QuincyKit to deliver crash reports to the server, from there they are symbolized with a standard symbolic crash script. The Xcode version used to indicate the crash is the same version used to build the binary, and I'm pretty sure the dSYM used to indicate the crash is correct: the line numbers for my code are correct, eg.

Anyone have any thoughts on this?

Edit: It should be added that this happens in a live app box, but only occasionally. This affected maybe 1 or 2 users in a thousand or so, but I could never reproduce it on either device or simulator.


source to share

1 answer

It looks like you called UIAlertViewDelegate after the notification has been issued.

Release it only in the dealloc method like this:

-(void)dealloc {
    self.alertView.delegate = nil; //setting delegate to nil
    self.alertView = nil; //if you have defined alert as property
    //other release statements of your controller
    [super dealloc];




All Articles