• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Making a text cell in a table editable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making a text cell in a table editable


  • Subject: Re: Making a text cell in a table editable
  • From: "Vitaly Ovchinnikov" <email@hidden>
  • Date: Thu, 10 Jul 2008 00:05:41 +0400

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
}

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@hidden> 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 (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

  • Follow-Ups:
    • Re: Making a text cell in a table editable
      • From: Jens Miltner <email@hidden>
References: 
 >Making a text cell in a table editable (From: Chris Idou <email@hidden>)
 >Re: Making a text cell in a table editable (From: Jens Miltner <email@hidden>)

  • Prev by Date: Re: Redrawing CALayer subclass when super layer is scaled
  • Next by Date: Set string value
  • Previous by thread: Re: Making a text cell in a table editable
  • Next by thread: Re: Making a text cell in a table editable
  • Index(es):
    • Date
    • Thread