NIB Init method for window subclasses
NIB Init method for window subclasses
- Subject: NIB Init method for window subclasses
- From: Ryan Joseph <email@hidden>
- Date: Wed, 25 Mar 2009 09:43:55 +0700
I have a window in a NIB file which I have assigned a class in the
"Class Identity" field and corresponding NSWindow subclass in code.
According to the reference (which is copied below) I think I should be
receiving a initWithCoder: message (there are only 3 options) but I
never get it. Custom classes and NSViews are both receiving init and
initWithFrame: respectively. Should NSWindow be getting this message
when it is instantiated from a NIB? If not, how do I know when
NSWindows are instantiated? Thanks for helping.
Standard Interface Builder objects (and custom subclasses of those
objects) receive an initWithCoder: message.
In Mac OS X, the list of standard objects includes the views, cells,
menus, and view controllers that are provided by the system and
available in the default Interface Builder library. It also includes
any third-party objects that were added to the Interface Builder
library using a custom plug-in. Even if you change the class of such
an object, Interface Builder encodes the standard object into the nib
file and then tells the archiver to swap in your custom class when the
object is unarchived.
In iPhone OS, any object that conforms to the NSCoding protocol is
initialized using the initWithCoder: method. This includes all
subclasses of UIView and UIViewControllerwhether they are part of the
default Interface Builder library or custom classes you define.
Regards,
Josef
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden