• 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: Post notification among several nib files?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Post notification among several nib files?


  • Subject: Re: Post notification among several nib files?
  • From: "Kyle Sluder" <email@hidden>
  • Date: Sat, 8 Mar 2008 13:50:21 -0500

On Sat, Mar 8, 2008 at 7:09 PM, Scott.D.R
<email@hidden> wrote:
>  Because it seems impossible to post a notification
>  from an object in a Nib file to another object in another Nib file.
>  I am wondering how to accomplish these:

Notifications aren't posted directly to interested objects... perhaps
you were thinking of messages?  It sounds like you're trying to set
the actions of the controls to objects in another nib, and found out
the hard way that this won't work.

You have two options:
1) Wire the action of the controls to some object in the same nib, and
have that post notifications to the default NSNotificationCenter.  The
object in the other nib listens for these notifications and acts
appropriately.

2) Use bindings.  Bind the controls to some object that is accessible
from both nibs (the application delegate is usually a good place to
put this).  No notifications are required.  Bindings are typically the
easier way to go about this, but they do require your model objects to
be KVO compliant.

HTH,
--Kyle Sluder
_______________________________________________

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

References: 
 >Post notification among several nib files? (From: "Scott.D.R" <email@hidden>)

  • Prev by Date: RE: Glyph Generator & hiding glyphs -> _NSBlockNumberForIndex() errors
  • Next by Date: Re: IB3 Application vs File Owner
  • Previous by thread: Re: Post notification among several nib files?
  • Next by thread: Core Data and indexed attributes question (from a CD noobie)
  • Index(es):
    • Date
    • Thread