Re: Reordering a table insanity
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