• 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: how do I access another Nib's controller?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how do I access another Nib's controller?


  • Subject: Re: how do I access another Nib's controller?
  • From: Mark Ritchie <email@hidden>
  • Date: Mon, 26 Mar 2007 23:18:44 -0400

On 26-Mar-07, at 10:28 PM, Theodore Petrosky wrote:
If I change owner:self] to owner:@"TheController"] (and TheController is the controller I want to talk to), how do I talk to it.

I posted some code recently which shows how to do this:
Date: Wed, 14 Mar 2007 23:00:57 -0400
From: Mark Ritchie <email@hidden>
Subject: Re: Reloading a window from NIB

The steps go something like this:
- pick an object that's going to own the NIB file
- define an outlet in that object who's type matches the controller you want to talk to
- in the nib file, set the File's Owner
- in the nib file, connect the outlet from File's Owner to the controller


then load the nib file with something like:
[NSBundle loadNibNamed:@"NibFileName" owner:object_who_owns_the_nib_file]


Assuming that everything worked correctly, the outlet you defined in step 2 above
will *magically* be connected to the controller inside your NIB file.
Now you are free to message the controller directly.


Good luck!
Mark
__
Mark Ritchie
Cocoa and WebObjects Developer
Diamond Lake Consulting Inc.
Toronto, Ontario, Canada



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >how do I access another Nib's controller? (From: Theodore Petrosky <email@hidden>)

  • Prev by Date: how do I access another Nib's controller?
  • Next by Date: Re: Creating a bitmap of a scaled-down NSImage
  • Previous by thread: how do I access another Nib's controller?
  • Next by thread: Key-Value Binding and Threads
  • Index(es):
    • Date
    • Thread