NSArrayController question
NSArrayController question
- Subject: NSArrayController question
- From: Oftenwrong Soong <email@hidden>
- Date: Tue, 10 Nov 2009 19:26:45 -0800 (PST)
Hi all,
I have a very common UI layout: a Master/Detail view. The Master is a NSTableView bound via a NSArrayController to a NSMutableArray, with buttons for Add and Remove whose Target/Action is the NSArrayController's add and remove actions. The Detail box displays attributes of the NSArrayController's current selection. Like I said, a pretty common setup.
I want to intercept the "add" action to fill in default information for the newly added item. I can't do this in the model's initializer because each item's default information will be computed based on all the prior information in the NSMutableArray. It belongs in the controller and not in the model. Is this an appropriate time to subclass NSArrayController? Is there a more elegant way to do it? Most of what I have read about subclassing says that you shouldn't do it. :)
Thanks,
Soong
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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