Modernise nib loading on the Mac

Originator:amorya
Number:rdar://13526149 Date Originated:28-Mar-2013 03:58 PM
Status:Open Resolved:
Product:OS X Product Version:10.8
Classification:Enhancement Reproducible:Always
 
This paragraph in the Resource Programming Guide is cause for concern:

"If the File’s Owner is not an instance of NSWindowController or NSViewController, then you need to decrement the reference count of the top level objects yourself. With manual reference counting, it was possible to achieve this by sending top-level objects a release message. You cannot do this with ARC. Instead, you cast references to top-level objects to a Core Foundation type and use CFRelease. (If you don’t want to have outlets to all top-level objects, you can use the instantiateNibWithOwner:topLevelObjects: method of the NSNib class to get an array of a nib file’s top-level objects.)"

I suggest that the Nib loading mechanism be modernised, and this behaviour be removed. The Guide mentions that "For historical reasons, in OS X the top-level objects in a nib file are created with an additional reference count". Apple have migrated away from historical API decisions before — just make every app compiled for MacOS 10.9 and above use the new version.

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!