Newbie question re: NSArrayController
Newbie question re: NSArrayController
- Subject: Newbie question re: NSArrayController
- From: Glenn Zelniker <email@hidden>
- Date: Mon, 19 Apr 2004 00:53:03 -0400
Hello, everyone. It's my first post, so sorry for butting in!
I have a document-based application with two NSTableViews. One of the
table views is bound to an array controller and the other isn't -- for
the unbound table I'm using the standard data-source methods to fill in
the data. The reason I'm doing it this way is that the unbound table
needs to have columns added and deleted and headers and identifiers
manipulated programatically and it seemed simpler to do it that way.
Here's the problem...
Changes to the bound table need to reflect in the unbound table. When I
add a row in the bound table, for example, a column needs to get added
to the unbound table. I was able to do this by posting a notification
from the added object's -init method, which is then observed by
MyDocument which then updates the columns on the unbound table. The
problem is with the delete method that comes with the
NSArrayController. I want the delete action on the bound table to
remove the corresponding column from the unbound table. I can't figure
out how to override the array controller's methods. In fact, I can't
even figure out where this object actually lives! I tried subclassing
my own array controller, but for some reason IB wouldn't allow me to
instantiate the class I created.
It appears that the NSArrayController uses some kind of key-value
scheme to find either the -init or createObject method for the object
that comprises the NSArray being controlled. The delete method seems
even simpler -- it just removes the object from the array, right? But
how can I actually get to the array controller and override its delete
method? Am I missing something?
Thanks in advance for any insight.
Glenn Zelniker
Z-Systems Audio Engineering
_______________________________________________
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.