On Mar 24, 2014, at 17:53 , Kyle Sluder <k...@ksluder.com> wrote: > On Mon, Mar 24, 2014, at 05:41 PM, Rick Mann wrote: >> I'm creating an NSViewController subclass by calling -init, and at no >> time passing a name for nibNameOrNil. According to the docs, this should >> result in an exception, but it's building my view based on the .xib of >> the same name without a problem. > > Where does the documentation say that? I can't find it. It would be > worthy of a docs bug since it differs from the implementation. > > --Kyle Sluder
So, it doesn't precisely say that calling -init will result in an exception. For -initWithNibName:bundle:, it says: "If you pass in a nil for nibNameOrNil then nibName will return nil and loadView will throw an exception; in this case you must invoke setView: before view is invoked, or override loadView." Since calling -init never affords a chance to pass in a nib name, and therefore -nibName shouldn't have a value, I would expect -loadView to throw. Normally I implement -init in my subclass and have it call -initWithNibName:bundle: with the NIB's name, but I hadn't gotten around to that yet, and it was working fine, and I was curious. -- Rick
signature.asc
Description: Message signed with OpenPGP using GPGMail
_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com