lionheart / openradar-mirror

A mirror of radars pulled from http://openradar.me/.
244 stars 17 forks source link

26916754: Crash on iOS 10 because PDFKit.framework has class PDFViewController without any prefix in name #14822

Open openradar-mirror opened 8 years ago

openradar-mirror commented 8 years ago

Description

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

Product Version: iOS 10 Beta 1 Created: 2016-06-21T12:38:28.519490 Originated: 2016-06-21T00:00:00 Open Radar Link: http://www.openradar.me/26916754

objectivecdeveloper commented 8 years ago

Happens to me too. Did you got any solution ??

hilalbaig commented 8 years ago

PDFViewController controller name wasted my couple of days to sort out runtime exception issue. At last i came to know controller name PDFViewController is used by PDFKit (a private framework used by Apple), fix by just changing controller name to PDFListViewController.