Re: NSArrayController question [Solved]
Re: NSArrayController question [Solved]
- Subject: Re: NSArrayController question [Solved]
- From: Mark Smith <email@hidden>
- Date: Tue, 10 Nov 2009 23:48:31 -0500
That's actually what I thought the answer should be when I saw your
original question, but really didn't know how to articulate it as I'm
new to cocoa programming myself.
Get some sleep. :-)
Best Regards,
Mark Smith
Sent from my iPhone
On Nov 10, 2009, at 11:26 PM, Oftenwrong Soong <email@hidden
> wrote:
Hi all,
Sorry. I'm just too tired to be programming right now. The solution
to my earlier question is to send the action to my document
controller instead of sending it to the NSArrayController. My
document controller's action method calls NSArrayController's
newObject, does its additional processing, and then calls
NSArrayController's addObject. For future reference, when you think
of subclassing framework classes, that's a sign that it's time for
bed. :)
Thanks,
Soong
----- Original Message ----
From: Oftenwrong Soong <email@hidden>
To: email@hidden
Sent: Tue, November 10, 2009 7:26:45 PM
Subject: NSArrayController question
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
_______________________________________________
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
_______________________________________________
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