Re: Calling subclassed methods on Cocoa objects
Re: Calling subclassed methods on Cocoa objects
- Subject: Re: Calling subclassed methods on Cocoa objects
- From: Larry Fransson <email@hidden>
- Date: Wed, 14 Apr 2004 12:41:39 -0700
On Apr 14, 2004, at 11:38, David Piasecki wrote:
In the init method of MyController, I call SetObject; however, when I
debug the application, it seems that SetObject never gets called.
Perhaps MyController needs to be initialized before I do any
operations on its objects? How else might I have both MyController and
MyImageView reference the same object?
- (void)init
{
[myimage SetObject:sharedObject];
}
1. Certainly, everything must be initialized before you can work on
anything. If it hasn't been initialized, it's probably nil, and you
can perform operations on nil all day long with no complaints from the
system.
2. Anything you want done to the interface when starting should be
done in the -awakeFromNib method. That gets called once the nib file
has been unpacked and all of the interface connections have been made.
Larry Fransson
Seattle, WA
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.