• 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: NSArrayController + NSTableView addObject ends editing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArrayController + NSTableView addObject ends editing


  • Subject: Re: NSArrayController + NSTableView addObject ends editing
  • From: Keary Suska <email@hidden>
  • Date: Thu, 14 Nov 2013 10:46:26 -1000

On Nov 14, 2013, at 8:04 AM, Trygve Inda <email@hidden> wrote:

>> On Nov 14, 2013, at 12:54 AM, Trygve Inda <email@hidden> wrote:
>>
>>> I have a NSTableView backed by an NSArrayController.
>>>
>>> If I am editing a cell in a row in the tableview and call addObject on the
>>> NSArrayController (to add a new row to the tableview), my editing session
>>> for some other row is ended.
>>>
>>> addObject is called from an NSNotification method when some other event
>>> happens in the app the requires a row be added to the table.
>>>
>>> How can I prevent the edit session from ending.?
>>
>> In the docs, - (BOOL)selectionShouldChangeInTableView:(NSTableView
>> *)aTableView is used for this purpose…
>>
>> HTH,
>>
>> Keary Suska
>> Esoteritech, Inc.
>>
>>
>>
>
> Note that when the new row is added, the selection does not change, but the
> editing of the cell is forced to end. The selection changes from a blue
> highlight to a grey one.


This is not because you are adding a row per se, but because the action is changing the first responder. If you don't want to allow changing the first responder you will need to subclass (the table view, cell, or window) to refuse to resign first responder status under the desired conditions.

HTH,

Keary Suska
Esoteritech, Inc.



_______________________________________________

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


References: 
 >Re: NSArrayController + NSTableView addObject ends editing (From: Trygve Inda <email@hidden>)

  • Prev by Date: Re: waitUntilDone: parameter when performing selector on main thread
  • Next by Date: Re: Why is there no -createFileAtPath: with an error return parameter?
  • Previous by thread: Re: NSArrayController + NSTableView addObject ends editing
  • Next by thread: Outpust stream/Native socket question:
  • Index(es):
    • Date
    • Thread