Storyboard targeting the wrong platform yields cryptic runtime exception

Originator:jalkut
Number:rdar://20955065 Date Originated:14-May-2015 11:01 AM
Status:Open Resolved:
Product:Developer Tools Product Version:
Classification: Reproducible:
 
Summary:
If you add a storyboard to a project but choose it from the wrong platform, e.g. add a Mac storyboard to an iOS target, Xcode will build and install the storyboard but it will fail to load at runtime with a cryptic runtime error:

*** Assertion failure in -[UIStoryboard initWithBundle:storyboardFileName:identifierToNibNameMap:designatedEntryPointIdentifier:], /SourceCache/UIKit_Sim/UIKit-3347.44.1/UIStoryboard.m:52

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: nibNameMap != nil'

It took me a while (and actually, stepping through assembly code in the debugger) to figure out that the error is based on unexpected keys in the Storyboard's Info.plist file. More here:

http://indiestack.com/2015/05/right-storyboard-wrong-platform/

It would have helped if either Xcode has prevented me from compiling/installing a Mac storyboard into an iOS app, or if the iOS UIStoryboard runtime would have failed with a more explanatory error.

Steps to Reproduce:


Expected Results:


Actual Results:


Version:
Version 6.4 (6E14)

Notes:


Configuration:


Attachments:

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!