Search code examples
iosios8uipopovercontroller

Why is my popover crashing in iOS 8.1 on iPhone 6 Plus? iOS 8 worked (actually Xcode 6.0 to 6.1 bug)


I was happy to see that Apple was allowing popovers on iPhone in iOS 8 (in certain cases anyway, larger iPhones, landscape only) and I switched some code from showing UIPickerview to UIPopoverController, like I use in this app for iPad. Now I'm getting reports of this crashing in iOS 8.1, and in my tests I see the crash on the second line below:

    XfrGraphTypeVC *graphTypePopover = [[XfrGraphTypeVC alloc]
                                    initWithNibName:@"XfrGraphTypeVC"
                                    bundle:[NSBundle mainBundle]
                                    type:xfrChannelMode cellHeight:cellHt];

self.popoverController = [[NSClassFromString(@"UIPopoverController") alloc] initWithContentViewController:graphTypePopover];

I've tried a few things to work around it, but no luck. Works fine still on iPad. Did Apple break something?

Edit: Still not working. Apple changed something in 8.1 to break this. What could be going on?

Edit: Now I think this started with Xcode 6.1, as apps built with Xcode 6.0 don't crash.

Crash Log:

    Incident Identifier: CD6192B8-363D-4EAB-9392-8A366D1FD10C
CrashReporter Key:   797d45c1f30283e0885ce0a30c88ccdf6fd78036
Hardware Model:      iPhone7,1
Process:             AudioTools [4530]
Path:                /private/var/mobile/Containers/Bundle/Application/5EDE9ACF-5372-45B8-B370-3AFFD345ED24/AudioTools.app/AudioTools
Identifier:          com.studiosixdigital.audiotools
Version:             7.3.11 (7.3.11)
Code Type:           ARM (Native)
Parent Process:      launchd [1]

Date/Time:           2014-11-11 17:10:31.927 -0800
Launch Time:         2014-11-11 17:10:26.147 -0800
OS Version:          iOS 8.1 (12B411)
Report Version:      105

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread:  0

Last Exception Backtrace:
0   CoreFoundation                  0x2379fc1f _exceptionPreprocess + 127
1   libobjc.A.dylib                 0x30fafc8b objc_exception_throw + 38
2   CoreFoundation                  0x2379fb65 +[NSException raise:format:] + 112
3   UIKit                           0x26e8a41b -[UIPopoverController _initWithContentViewController:popoverControllerStyle:] + 266
4   AudioTools                      0x004f4065 0x69000 + 4763749
5   UIKit                           0x26c8fc2b -[UIApplication sendAction:to:from:forEvent:] + 70
6   UIKit                           0x26c8fbd1 -[UIControl sendAction:to:forEvent:] + 44
7   UIKit                           0x26c7a863 -[UIControl _sendActionsForEvents:withEvent:] + 582
8   UIKit                           0x26c8f63d -[UIControl touchesEnded:withEvent:] + 588
9   UIKit                           0x26c8f317 -[UIWindow _sendTouchesForEvent:] + 522
10  UIKit                           0x26c88be1 -[UIWindow sendEvent:] + 544
11  UIKit                           0x26c5f3dd -[UIApplication sendEvent:] + 196
12  UIKit                           0x26ed2c29 _UIApplicationHandleEventFromQueueEvent + 13888
13  UIKit                           0x26c5de39 _UIApplicationHandleEventQueue + 1296
14  CoreFoundation                  0x23766377 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
15  CoreFoundation                  0x23765787 __CFRunLoopDoSources0 + 218
16  CoreFoundation                  0x23763ded __CFRunLoopRun + 772
17  CoreFoundation                  0x236b2211 CFRunLoopRunSpecific + 476
18  CoreFoundation                  0x236b2023 CFRunLoopRunInMode + 106
19  GraphicsServices                0x2aa650a9 GSEventRunModal + 136
20  UIKit                           0x26cbe1d1 UIApplicationMain + 1440
21  AudioTools                      0x0007c647 main + 50
22  AudioTools                      0x0006d028 start + 40

Solution

  • OK so I downloaded Xcode 6.0.1 and now this all works again. So it's something Apple broke in Xcode 6.1. I thought it was in iOS 8.1 because that happened at the same time.