Re: Details and the concepts related to the Nib Window
Re: Details and the concepts related to the Nib Window
- Subject: Re: Details and the concepts related to the Nib Window
- From: James Bucanek <email@hidden>
- Date: Tue, 23 Mar 2010 08:39:05 -0700
Jon Pugh <mailto:email@hidden> wrote (Monday,
March 22, 2010 11:22 PM -0700):
I presume he means via a breakpoint in the debugger. Typically people put a
breakpoint in init and don't see it being hit because init isn't called,
initWithCoder is what is used when unarchiving objects from a nib, but that's
a tough one to break in.
Just for completeness:
o Generally, objects that IB understands (i.e. the objects in
the Library) are instantiated using -initWithCoder:. This is how
IB initializes the object with the properties that you've
defined in IB.
o Custom subclasses of NSObject are instantiated with -init
(this is so you don't have to make an object conform to NSCoding
to use it in IB).
o Custom subclasses of NSView are instantiated with
-initWithFrame: (to be consistent with NSView's designated
constructor, and also to avoid the NSCoding requirement).
Typically, the first place your Interface Builder objects/delegates get called
is awakeFromNib. That's the place to put a breakpoint where you can see the
things you created in Interface Builder.
Agreed!
--
James Bucanek
_______________________________________________
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