Connect to NSObjects in other scenes (or storyboard-level objects)

Originator:robnapier
Number:rdar://25450179 Date Originated:30-Mar-2016 05:43 PM
Status:Open Resolved:
Product:iOS SDK Product Version:Xcode 7.3
Classification:Enhancement Reproducible:Not Applicable
 
If a storyboard object is a simple subclass of NSObject (i.e. not a GUI element), you cannot bind to it from other scenes, and you must put all objects in a specific scene. This prevents providing objects that are created by the Storyboard and are directly bindable to outlets, which would allow IBOutlets to replace singletons, much as the NSAppDelegate is provided by the main NIB on OS X.

For example:

Create an iOS “Master/Detail” project

Create a class “NetworkController”

In the Master Scene, drag an “Object” and set its class to NetworkController. (Ideally this should be possible to place at the top-level rather than in a scene, but that is currently impossible.)

In DetailViewController create an IBOutlet of type NetworkController.

Try to bind the DetailViewController’s outlet to the previously created NetworkController in the Master Scene.

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!