Problems subclassing NSWindowController while keeping bindings working
Problems subclassing NSWindowController while keeping bindings working
- Subject: Problems subclassing NSWindowController while keeping bindings working
- From: Laurent Daudelin <email@hidden>
- Date: Wed, 28 Feb 2007 15:36:05 -0500
- Thread-topic: Problems subclassing NSWindowController while keeping bindings working
Hello!
I'm working on an NSDocument-based application targeting 10.4. I created my
NSDocument subclass and added all the controllers needed to display the
content of my document in a table view. The table view contains a few
popups, a textfield and a segmented control. All the bindings work
perfectly, all the popups and other fields are populated correctly and my
document content is displayed just fine.
However, I need to be able to save my document windows frame and reopen them
at the same location. I've tried to put the save frame into various places
but it didn't work. So, I decided to subclass NSWindowController. Bad move!
I've been working on this for several days now and I can't seem to make it
work. I made my NSWindowController subclass the file owner of my nib. I the
created an instance of my NSDocument subclass to I could redo my bindings. I
did modify the bindings to get their contents from the NSDocument subclass
instance, but that didn't work. I even deleted all my array controllers and
recreated them, carefully checking the bindings but it still doesn't work.
Desperate, I added the arrays used to populate the popups in my table view
to my NSWindowController subclass. Then, it was half working. My document
content was not displayed but if adding new rows to the table view, they
would appear and work correctly. I changed the bindings back to my
NSDocument subclass instance, and nothing works anymore.
Why can't I just change the content object for the array controllers? Is
there some kind of hard coded stuff going on in my back where the bindings
will only work with the File Owner of the nib? What am I missing?
Thanks in advance for any pointer, help or info!
-Laurent.
--
============================================================================
Laurent Daudelin AIM/iChat/Skype:LaurentDaudelin <http://nemesys.dyndns.org>
Logiciels Nemesys Software mailto:email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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