• 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
Binding to a controller in a different nib
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Binding to a controller in a different nib


  • Subject: Binding to a controller in a different nib
  • From: Randall Meadows <email@hidden>
  • Date: Thu, 28 Feb 2008 10:47:37 -0700

Please help me extend my understanding of bindings...I grasp the simple stuff, but not yet to an extent to be able to apply that to complex situations.

In my main window (which resides in it's own nib, and is controlled by a custom window controller), I have a combobox. I'd like to populate the contents of that via bindings.

In my main nib file is where the controller lives that maintains the information that I want to populate that combobox with. This controller has a dictionary ("infoDictionary"), and the keys of that dictionary are what I want displayed in the combobox.

My main window class has a member variable (I'm calling this "infoController") that is a link to that information controller. So, I attempted to set up the binding on the combobox as:

Bind to: File's Owner (which is my custom window controller)
Model Key Path: infoController.infoDictionary.allKeys

Truth be told, I didn't really expect that work (and I wasn't disappointed), but I'm really clueless as to what *should* work.

As another stab in the dark, when I set the contents of that dictionary, I tried wrapping that code around calls to:

[self willChangeValueForKey:@"infoController.infoDictionary.allKeys"];
<populate the dictionary here>
[self didChangeValueForKey:@"infoController.infoDictionary.allKeys"];

and that likewise didn't work; the combobox remains empty. (I also tried throwing a "self." at the beginning of the Model Key Path to no avail.)

I also get no output in my debugger console that might lead me to a clue as to what I'm doing wrong.

Help, please?  Thanks!
randy
_______________________________________________

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: Binding to a controller in a different nib
      • From: "Kyle Sluder" <email@hidden>
    • Re: Binding to a controller in a different nib
      • From: Randall Meadows <email@hidden>
  • Prev by Date: Re: Drawing from secondary thread erases resize corner in window? [solved, for now]
  • Next by Date: Can someone send me the MoreAuthSample?
  • Previous by thread: Re: RTF pasting as plain text in NSTextView in some cases
  • Next by thread: Re: Binding to a controller in a different nib
  • Index(es):
    • Date
    • Thread