Re: What to subclass in NSArrayController to enable immediate editing of added rows?
Re: What to subclass in NSArrayController to enable immediate editing of added rows?
- Subject: Re: What to subclass in NSArrayController to enable immediate editing of added rows?
- From: "Sean McBride" <email@hidden>
- Date: Tue, 1 Dec 2009 17:05:04 -0500
- Organization: Rogue Research Inc.
On 12/1/09 1:51 PM, David Hirsch said:
>Well, that is a nice bit of code to have, but it doesn't really
>address the issue. As I wrote in my original post, there are a number
>of published methods for handing this in (for example) the NSDocument
>subclass. What *I* want to do is handle it in my NSArrayController
>subclass, for encapsulation purposes - I have a number of different
>tables for which I want to enable this, and I'd like to keep the
>functionality separate. I am looking into the suggestion of
>subclassing NSArrayController's addObject: method, which seems likely
>to work.
NSArrayController is a model-controller, seems a little odd to me that
you would want it to be aware of NSView instances. Not that MVC must be
followed religiously, but still.
Personally, I have found NSObjectController's add: to be generally
useless, since you do not get access to the newly created model object.
I've found I almost always need my own action method. From it, I create
a new model object, customize it, and make it the selected object. The
table updated by KVO. It's only one more line to edit the table's
cell. True, you copy-paste that line everywhere, but oh well.
>Also, the scrollRowToVisible call is superfluous, since the
>editColumn:row:withEvent:select: method is documented to do the
>scrolling for you already.
So it is..., thanks. The scrolling code predates by auto editing code.
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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