Re: fundamental question: how do I call controller methods from other classes?
Re: fundamental question: how do I call controller methods from other classes?
- Subject: Re: fundamental question: how do I call controller methods from other classes?
- From: Jens Alfke <email@hidden>
- Date: Wed, 21 May 2008 19:06:24 -0700
On 21 May '08, at 5:07 PM, Matthew Youney wrote:
The name of the controller object in interface builder is
myPOSsocketController, and the following gives the compiler error
"myPOSsocketController undeclared or first use in function"
If you want an object in a nib to know about another one, then modify
its class to add an instance variable declared as an IBOutlet:
@interface POSocket
{
...
IBOutlet POSocketController myController;
Save the .h file and IB will now know about that outlet, and you can
control-drag from the POSocket to the controller and assign the
myController instance variable.
Typically what happens is that you have a controller object (often an
NSWindowController) that's the nib's owner, and you add outlets to it
for all the other nib objects you need to reference directly. It's
rarer for other objects in the nib to have outlets pointing to each
other, but it happens sometimes.
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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