• 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: "Shawn Erickson" <email@hidden>
  • Date: Wed, 21 May 2008 17:26:30 -0700

On Wed, May 21, 2008 at 5:07 PM, Matthew Youney <email@hidden> wrote:

> What is the instance name of the controller object instantiated by Interface Builder?

They do not have a name... at least not in the way you appear to be
asking. Objects in the nib or external objects (file owner, etc. [1])
can have references to other objects in a nib established by creating
connections graphically (control dragging between objects). Those
references are stored in instance variables that you define in code
(or inherit from a superclass). So the "name" is nothing more then the
instance variable you defined and told interface builder to use when
you made the connection interface builder.

> What am I missing?

You simply need instances of "other" class to have a reference
(pointer) to an instance of your controller class. Then they can send
messages to the controller class instance.

Review the following and in particular the discussion of IBOutlets
which hopefully will better explain how Interface Builder works in
this regard.

<http://developer.apple.com/documentation/DeveloperTools/Conceptual/IB_UserGuide/ConnectionsandBindings/chapter_6_section_1.html#//apple_ref/doc/uid/TP40005344-CH7-SW1>

Also review...

[1] <http://developer.apple.com/documentation/DeveloperTools/Conceptual/IB_UserGuide/ApplicationBasics/chapter_3_section_2.html#//apple_ref/doc/uid/TP40005344-CH3-SW15>
_______________________________________________

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: "Shawn Erickson" <email@hidden>
References: 
 >fundamental question: how do I call controller methods from other classes? (From: "Matthew Youney" <email@hidden>)

  • Prev by Date: Re: create a directory (UTF8 string) in cocoa
  • Next by Date: Re: fundamental question: how do I call controller methods from other classes?
  • Previous by thread: 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