Re: Could not connect the action to target of class
Re: Could not connect the action to target of class
- Subject: Re: Could not connect the action to target of class
- From: Sherm Pendley <email@hidden>
- Date: Fri, 11 Mar 2005 17:13:04 -0500
On Mar 11, 2005, at 3:38 PM, Hamish Allan wrote:
Thank you, but I'm still somewhat confused as to what I should be
doing. I've changed back the custom class of my File's Owner to my
Document class, added a new IBOutlet myWindowController to that class,
instantiated my Controller object in IB, and connected the
instantiated Controller to the File's Owner's (i.e., my Document
class's) myWindowController variable. However, when it comes to time
to makeWindowControllers (i.e., when I try to open a document) the
variable myWindowController is still (null).
Unless you have a specific reason for needing a separate controller,
don't create one. Just delete it, delete the myController outlet, and
put your action methods in your document class.
If you're working with a complex app that needs multiple window
controllers, or a subclass of NSWindowController, override
-makeWindowControllers in your document class and create the
controllers there.
If you need to initialize GUI elements or other outlets you've
connected in IB, you can't do that in -makeWindowControllers; the Nib
hasn't yet been loaded at that point. Instead, do that in your document
class' -windowControllerDidLoadNib: method.
sherm--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden