• 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: 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

  • Follow-Ups:
    • Re: Reordering a table insanity
      • From: Quincey Morris <email@hidden>
References: 
 >Reordering a table insanity (From: Graham Cox <email@hidden>)
 >Re: Reordering a table insanity (From: Quincey Morris <email@hidden>)
 >Re: Reordering a table insanity (From: Graham Cox <email@hidden>)
 >Re: Reordering a table insanity (From: Graham Cox <email@hidden>)
 >Re: Reordering a table insanity (From: Quincey Morris <email@hidden>)
 >Re: Reordering a table insanity (From: Graham Cox <email@hidden>)
 >Re: Reordering a table insanity (From: Quincey Morris <email@hidden>)
 >Re: Reordering a table insanity (From: Quincey Morris <email@hidden>)
 >Re: 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: Does anyone find Restore Snapshot kind of weak?
  • Previous by thread: Re: Reordering a table insanity
  • Next by thread: Re: Reordering a table insanity
  • Index(es):
    • Date
    • Thread