• 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: Reordering a table insanity
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reordering a table insanity


  • Subject: Re: Reordering a table insanity
  • From: Graham Cox <email@hidden>
  • Date: Wed, 28 Nov 2012 14:17:37 +1100

On 28/11/2012, at 1:52 PM, Quincey Morris <email@hidden> wrote:

> I assume you're using begin/endUpdates around this loop to have a single animation for the whole thing? In that case, it'd be a lot easier to use removeRowsAtIndexes/insertRowsAtIndexes, since the only index that needs to be adjusted is targetIndex (it needs to be decreased by the number of indexes in items that are less than the original targetIndex). That is, you would adjust targetIndex after the removal and before constructing the index set for the insertion.

Yes, I'm bracketing this with begin/endUpdates.

I'll try that approach, it does sound easier. Thanks.

> I doubt that anything short of a hit of a mind-altering drug is gonna make it fun to do.


Yup ;-)

--Graham
_______________________________________________

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: Reordering a table insanity
      • From: Graham Cox <email@hidden>
References: 
 >Reordering a table insanity (From: Graham Cox <email@hidden>)
 >Re: Reordering a table insanity (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Reordering a table insanity
  • Next by Date: Re: Reordering a table insanity
  • Previous by thread: Re: Reordering a table insanity
  • Next by thread: Re: Reordering a table insanity
  • Index(es):
    • Date
    • Thread