Unbinding something / binding to nil
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