Xcode should help add correct framework when non-UIKit view is added in IB

Originator:dempsey
Number:rdar://13385780 Date Originated:09-Mar-2013 11:35 AM
Status:Open Resolved:
Product:Developer Tools Product Version:Version 4.6 (4H127)
Classification:Enhancement Reproducible:Not Applicable
 
There are some views in the IB library that are not part of UIKit (For instance, MKMapView or GLKitView).

If a user drags those into a storyboard or nib and forgets to add the framework to the project, the result is a runtime error that can be confusing, and not very helpful for the user, especially a new developer:

"2013-03-09 11:13:42.166 MapTest[13131:c07] *** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named MKMapView'
*** First throw call stack:
(0x1c90012 0x10cde7e 0x1c8fdeb 0x33d22c 0x33d418 0x33d0e5 0x5167a 0x33da02 0x33d0e5 0x22e5c8 0x33da02 0x33d418 0x33d0e5 0x22d9f0 0xf27e7 0xf2dc8 0xf2ff8 0xf3232 0x423d5 0x4276f 0x42905 0xa644ab6 0x4b917 0xf96c 0x1094b 0x21cb5 0x22beb 0x14698 0x1bebdf9 0x1bebad0 0x1c05bf5 0x1c05962 0x1c36bb6 0x1c35f44 0x1c35e1b 0x1017a 0x11ffc 0x1fad 0x1ed5 0x1)
libc++abi.dylib: terminate called throwing an exception"

It would be great if IB or Xcode could:
     - Notice that a non-UIKit item is being dragged into the storyboard/nib
     - Check if the correct system framework is added to the project
     - Give the user an easy way to add the correct framework

This could possibly be a check done immediately when the item is dragged into the storyboard, or possibly a compile time check and warning when the nib is compiled.

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!