Re: -init and awakeFromNib called twice.
Re: -init and awakeFromNib called twice.
- Subject: Re: -init and awakeFromNib called twice.
- From: Jonathan Hess <email@hidden>
- Date: Fri, 25 Apr 2008 15:14:00 -0700
Hey John -
If init is being called twice on the same instance, that sounds like a
bug. It should be pretty easy to figure out with a backtrace in the
debugger. Of course, you should make sure there aren't two different
instances.
AwakeFromNib on the other hand will be called once each time you load
a nib that references your object. Typically this means that
awakeFromNib is called only once because most objects are only in one
NIB. If you're object loads additional NIB files and is the file's
owner, it will be called additional times.
Good Luck -
Jon Hess
On Apr 25, 2008, at 9:41 AM, Johnny Lundy wrote:
I know I saw something somewhere in reference to these methods
getting called twice on app launch, but can't find it with searching.
Is this expected behavior for vanilla -init and (void) awakeFromNib
methods? I'm doing some short loops in these methods and calling
other instance methods. For now, no harm is done with all this stuff
being done twice, but I'd rather not have to worry about that if I
add code.
I don't see most examples routinely checking for a second invocation
in these init methods so I wonder what is going on.
Other than that, all the advice I got here has worked and I now have
350 lines of code and only one line is glue. Very nice learning
experience for Bindings and I thank all who helped.
_______________________________________________
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
_______________________________________________
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