Re: Editing in a tableview without selecting
Re: Editing in a tableview without selecting
- Subject: Re: Editing in a tableview without selecting
- From: Ben Haller <email@hidden>
- Date: Mon, 2 Nov 2009 09:46:49 -0500
On 1-Nov-09, at 9:04 PM, Ben Haller wrote:
On 1-Nov-09, at 6:01 PM, Graham Cox wrote:
On 02/11/2009, at 4:42 AM, Ben Haller wrote:
But where? I've been hunting for a -setEditable:YES method
somewhere that I need to call, but I haven't found it...
Have you tried -setEditable:YES on the textfield cell you're using
for the table column? (Inherited from NSCell). I'm not sure what
its default state is, documentation doesn't say.
Just tried it; makes no difference.
OK, I really did try this back then, and it really didn't make any
difference. Really.
But having just spent the whole morning ripping swaths of code out
of my app to construct a simple test case, when I put setEditable:
into my test app to confirm that it still didn't matter, lo and
behold, editing worked. Went back to my original app, put it in there
again, and of course it works there too. No idea how I screwed up the
first time I tried it. Sigh.
So, for the record: when constructing an NSTableView in code, if
you want it to be editable you must call -setEditable:YES on its data
cells. Seems a little silly to me (the column knows its editable, the
delegate says its editable... do we really need a whole choir of
objects all singing "it is editable" in harmony?), but there it is.
Thanks to Graham for finding the solution, and thanks to everybody
else for their help as well.
Ben Haller
Stick Software
_______________________________________________
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