Re: [NSOutlineView/NSTableView] Returning nil enables auto-edition?
Re: [NSOutlineView/NSTableView] Returning nil enables auto-edition?
- Subject: Re: [NSOutlineView/NSTableView] Returning nil enables auto-edition?
- From: Corbin Dunn <email@hidden>
- Date: Fri, 13 Jun 2008 11:23:21 -0700
You probably mean, editing (not edition).
I have a NSOutlineView. One of the column data cell of this view is
a text field cell which is potentially editable.
Now, if I return nil in
- (id) outlineView:(NSOutlineView *) inOutlineView
objectValueForTableColumn:(NSTableColumn *) inTableColumn byItem:
(id) inItem
You probably don't want to do that; you should return an item. The
returned value is set to the objectValue on the cell at that row/column.
and then later set the string value (through setStringValue:) in
- (void) outlineView:(NSOutlineView *) inOutlineView willDisplayCell:
(NSCell *)cell forTableColumn:(NSTableColumn *) inTableColumn item:
(id) inItem
there's a very weird behavior with leaf rows:
When I select them (first click, it's not like the default behavior
in 10.5), the text field cell automatically enters edition mode
without even asking the opinion of
- (BOOL) outlineView:(NSOutlineView *) inOutlineView
shouldEditTableColumn:(NSTableColumn *) inTableColumn item:(id)inItem
First off -- 10.4 *requires* a double click to begin an editing
session. Are you sure you aren't manually starting the editing by
calling - (void)editColumn:(NSInteger)column row:(NSInteger)row
withEvent:(NSEvent *)theEvent select:(BOOL)select;
In fact, you can break on that method and see when it is invoked, and
look at the bt to figure out why.
Is it a bug or just an unsupported scenario?
I don't think it should happen the way you described, see the notes
above. Really, you should return non-nil from the method. I have a
feeling something else is going on.
corbin
_______________________________________________
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