Re: Reordering a table insanity
Re: Reordering a table insanity
- Subject: Re: Reordering a table insanity
- From: Graham Cox <email@hidden>
- Date: Thu, 29 Nov 2012 12:24:26 +1100
On 29/11/2012, at 12:02 PM, Quincey Morris <email@hidden> wrote:
> That means you'd need a different though similar twelve lines of code to implement the reverse algorithm. That in turn means you'd need to know which direction you were going, so there might need to be a 3rd "direction" parameter (or it might be clear from the context, depending on how your undo works).
>
> Does that sound plausible?
It sounds plausible, but as I have found repeatedly, the devil is in the details.
Ideally I'd like the following method signature:
- (void) moveStuffFrom:(NSIndexSet*) source to:(NSIndexSet*) destination;
which internally calls [ [undoManager prepare...] moveStuffFrom:destination to:source]; to set up undo.
this implies that the algorithm must by symmetric or universal, in that the two index sets supply all the necessary information, without any extra direction parameters (though that could be derived).
I'm not sure I want to spend much more time on this as I have so much else to do, but perhaps if inspiration struck you (or anyone) out there ;-)
I tell you one thing, if a solution to this can be developed, I'm going to enshrine it in some sort of general code I can reuse because doing this is pretty common. Even better would be something in NSTableView...
--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