• 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: Controller binding dies in 2nd NIB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Controller binding dies in 2nd NIB


  • Subject: Re: Controller binding dies in 2nd NIB
  • From: Fritz Anderson <email@hidden>
  • Date: Thu, 29 Jan 2004 11:29:11 -0600

I've found the solution, and my earlier investigations were mostly red herrings.

What I had done was to implement in my subclass of NSObjectController the method observeValueForKeyPath:ofObject:change:context:. The documentation leaves to the reader's hours of reflection and hard experience the insight that this is the only route through which _all_ binding messages flow via the controller. If you implement it, you are actually _overriding_ it.

It is therefore vitally important to pass the message along to super when you are done with it.

This might be an area for attention in future revisions of the documentation.

-- F

On 28 Jan 2004, at 6:05 PM, Fritz Anderson wrote:

I have a window (call it the Problem Window), controlled with an NSObjectController subclass, that works well when it, the controller, and the model are loaded in the main NIB of an application. I now want to "demote" this window to be opened secondary to another MVC complex -- the main complex shows a list of objects each of which could be displayed by a Problem Window.

What makes it a Problem is that the control bindings seem to disappear after loading time.
...
The contents of the NSTextField do not change, then or ever after. Which means the binding has somehow broken, or I've missed a secret ritual (or fundamental concept) somewhere.

Further experiments show: The simple arrangement I've shown works fine when run from the main NIB. It also works fine when run from a NIB loaded by a simple control action. I will continue to try to approach the complexity of my problem case. (The parent, NIB-launching controller is itself an NSController, for instance.)

Can someone tell me what my block on this might be?

-- F
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Controller binding dies in 2nd NIB (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: Notification redundancy
  • Next by Date: Re: Notification redundancy
  • Previous by thread: Controller binding dies in 2nd NIB
  • Next by thread: Changing the Window level upon dragging.
  • Index(es):
    • Date
    • Thread