• 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
Unbinding something / binding to nil
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unbinding something / binding to nil


  • Subject: Unbinding something / binding to nil
  • From: Ken Tabb <email@hidden>
  • Date: Mon, 11 Jul 2005 17:04:33 +0100

Afternoon folks,

so bindings then... sob...

I have a doc based app with a global (app level) inspector palette, which binds all the controls in the palette to my app's delegate's 'frontmostDocument', thus in IB a standard textfield might be bound like this:

Bind to: Frontmost doc (see below)
Controller Key: selection
Model Key Path: myArrayController.selection.description

In turn Frontmost doc is an instantiation of an object controller set up thus:
Bind to: File's Owner (NSApplication)
Controller Key: (none)
Model Key Path: delegate.frontmostDocument


Suffice it to say that the delegate sets the 'frontmostDocument' object accordingly, and when no document is open (as in they've all been closed, or when the app launches) sets that to nil and releases the previously retained object.

When I launch the app (no documents) it works great; all the controls display their respective "no selection" placeholders. When I open 1 document, it all works fine. When I open a second document, it works fine. When I flip between documents, it works fine.

When I close both documents though, the controls no longer revert to their "no selection" placeholders, even though my app's delegate's - frontmostDocument now returns nil.

I can't help thinking I'm barking up the wrong tree somewhat? Any clues from what I've said so far?

Thanks in advance for any black magic you can bestow upon me,
Ken

- - - - - - - - - -
Dr. Ken Tabb
Mac & UNIX Developer - Health & Human Sciences
Machine Vision & Neural Network researcher - School of Computer Science
University of Hertfordshire, UK
http://www.health.herts.ac.uk/ken/

Certified non-Microsoft Solution Provider

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: SOAP Handler question
  • Next by Date: Re: Cocoa-Java Bridge collapse
  • Previous by thread: Re: Inserting Special Characters into a String
  • Next by thread: NSSlider and integer values
  • Index(es):
    • Date
    • Thread