Am 9.7.08 um 22:05 schrieb Vitaly Ovchinnikov:

I have a similar question. My NSTableView is bound to
NSArrayController and I need to make cell editable immediately after
adding new row. Rows added with default values and I need to allow
user to edit them easy. I have an "Add" button that fires action like
this:

- (void) onAdd: (id) sender
{
    [arrayController insert:self]; // creates new object
    // here I need to select new cell and start editing
}

Haven't ever had this problem, but have you tried

- (void) onAdd: (id) sender
{
    [arrayController insert:self]; // creates new object

    [tableView reloadData]; // <-- make table view reload it's data

[tableView editColumn:...]; // maybe table view now knows about the new row?
}



If I call -editColumn:row:withEvent:select immediately after -insert -
it does nothing. It seems that NSTableView will be updated a bit
later, so I find out this way:

I call [self performSelector:@selector(doBeginEditing) withObject:nil
afterDelay:0];

and in -doBeginEditing I call [grid editColumn:row:withEvent:select].
This works but I feel that the more clear way exists. Does it?

On Wed, Jul 9, 2008 at 1:54 PM, Jens Miltner <[EMAIL PROTECTED]> wrote:

Am 09.07.2008 um 08:09 schrieb Chris Idou:


How do I programmatically make a text cell in a NSTableView to have focus
and be in edit mode?

I believe -[NSTableView editColumn:(NSInteger)columnIndex
row:(NSInteger)rowIndex withEvent:(NSEvent *)theEvent select: (BOOL)flag] is
the method you want to call...

HTH,
</jum>





_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/vitaly.ovchinnikov%40gmail.com

This email sent to [EMAIL PROTECTED]


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to