• 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: Outline view selection doesn't move when items are inserted?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Outline view selection doesn't move when items are inserted?


  • Subject: Re: Outline view selection doesn't move when items are inserted?
  • From: Jerry Krinock <email@hidden>
  • Date: Wed, 16 Jan 2008 21:59:04 -0800


On 2008 Jan, 16, at 19:00, John Stiles wrote:

I would have assumed that the selection tracks an /item/, and doesn't just sit on a particular row.


Is this behavior to be expected? Seems kinda weird to me.

Well, since you didn't expect it, it is "not expected". However, I do believe that this is the way it has always worked. Probably has something to do with the data source being a separate object.


In my code, I get the 'selectedObjects' before -reloadData, then after -reloadData, restore it. Here is some ugly old code I found while verifying my memory:

// Restore selection
e = [selectedObjects objectEnumerator] ;
NSMutableIndexSet* selectionIndexes = [[NSMutableIndexSet alloc] init] ;
while ((item = [e nextObject])) {
int index = [outlineView rowForItem:item] ;
if (index != NSNotFound) {
[selectionIndexes addIndex:index] ;
}
}
[outlineView selectRowIndexes:selectionIndexes
byExtendingSelection:NO] ;
[selectionIndexes release] ;


_______________________________________________

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: Outline view selection doesn't move when items are inserted?
      • From: John Stiles <email@hidden>
References: 
 >Outline view selection doesn't move when items are inserted? (From: John Stiles <email@hidden>)

  • Prev by Date: new API for MacBook Air for Multi-touch trackpad?
  • Next by Date: Re: new API for MacBook Air for Multi-touch trackpad?
  • Previous by thread: Outline view selection doesn't move when items are inserted?
  • Next by thread: Re: Outline view selection doesn't move when items are inserted?
  • Index(es):
    • Date
    • Thread