• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: fundamental question: how do I call controller methods from other classes?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • RE: fundamental question: how do I call controller methods from other classes?
      • From: "Matthew Youney" <email@hidden>
References: 
 >fundamental question: how do I call controller methods from other classes? (From: "Matthew Youney" <email@hidden>)

  • Prev by Date: Re: RDBMS suggestions for CoreData
  • Next by Date: Re: How to schedule an autonomous (SMTP/FAX) service.
  • Previous by thread: Re: fundamental question: how do I call controller methods from other classes?
  • Next by thread: RE: fundamental question: how do I call controller methods from other classes?
  • Index(es):
    • Date
    • Thread