Crash on iOS 10 because PDFKit.framework has class PDFViewController without any prefix in name
| Originator: | constantine.fry | ||
| Number: | rdar://26916754 | Date Originated: | 21-Jun-2016 |
| Status: | Open | Resolved: | |
| Product: | iOS 10 Beta 1 | Product Version: | iOS 10 Beta 1 |
| Classification: | Crash | Reproducible: | Always |
Summary: Our app has class named `PDFViewController` and links `QuickLook.framework`. When we load this view controller from storyboard app crashes with an exception: [PDFViewController initWithCoder:]: unrecognized selector sent to instance. It happens because PDFKit.frameworks has PDFViewController as well and runtime choses to use view controller from PDFKit instead of the PDFViewController from application. Steps to Reproduce: 1. Download Sample project. 2. Run it on iOS 10 Beta 1. 3. You will se an exception: objc[1138]: Class PDFViewController is implemented in both /System/Library/PrivateFrameworks/PDFKit.framework/PDFKit (0x1b3116220) and /var/containers/Bundle/Application/E8456F64-BBCE-4892-8A51-52919BC07E4D/PDFViewController-Objc-2.app/PDFViewController-Objc-2 (0x100084c50). One of the two will be used. Which one is undefined. Exception - -[PDFViewController initWithCoder:]: unrecognized selector sent to instance 0x170017e80libc++abi.dylib: terminating with uncaught exception of type NSException Expected Results: App shouldn't crash. The classes in system frameworks should be prefixed to avoid duplicate class names. Actual Results: Error log and exception: objc[1138]: Class PDFViewController is implemented in both /System/Library/PrivateFrameworks/PDFKit.framework/PDFKit (0x1b3116220) and /var/containers/Bundle/Application/E8456F64-BBCE-4892-8A51-52919BC07E4D/PDFViewController-Objc-2.app/PDFViewController-Objc-2 (0x100084c50). One of the two will be used. Which one is undefined. Exception - -[PDFViewController initWithCoder:]: unrecognized selector sent to instance 0x170017e80libc++abi.dylib: terminating with uncaught exception of type NSException Version: iOS 10.0 Beta 1 (14A5261v) Notes: Configuration: iPhone SE (Model A1662, A1723, A1724) Sample Project: https://drive.google.com/file/d/0B4rdRohVMqOIamg5WEx0bzF2a0U/view?usp=sharing
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!