Re: NSUndoManager retain/release of arguments - ad infinitum
Re: NSUndoManager retain/release of arguments - ad infinitum
- Subject: Re: NSUndoManager retain/release of arguments - ad infinitum
- From: steven Hooley <email@hidden>
- Date: Tue, 11 Jan 2011 11:27:47 +0000
I don't mean to hijack this thread, but my first thought, for what
it's worth is that either :-
a) sort order is a property of the window, not your model and
shouldn't be undoable at all.
What happens if you want another view - say a grid view, with nice big
icons - of the same data?. Should that be sorted in the same way as
your tableView? Should clicking the tableView header rearrange views
in other windows? If not.. now you have an undo-stack per window and
you must make sure that they stay in sync. ie. Adding and removing
items happens in both views, and removing an item from one view is
undoable in another, but the sorting and undoing sorting only applies
to the relevant view. This will get pretty messy pretty quickly.
Ok, so you never want to add another view, you're happy with the
single table view. I expect an undoable-action to be a
saveable-action. ie, normally, if i can undo it i expect it to make
the document dirty and need saving. This might be different in your
app but i don't normally expect to have to Save a document because i
switched between sorting alphabetically-ascending and
alphabetically-descending order.
OR b)
the sort order is inherently part of your model, your data is an
ordered-set and the user can arbitrarily order the items as she
pleases. In this case you probably won't be presenting your data with
a sort descriptor, clicking on the column header will actually
rearrange your model data.
Undo/Redo often makes my head hurt, and not always the fault of NSUndoManager.
_______________________________________________
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