RE: Undo with Table View and array controller
RE: Undo with Table View and array controller
- Subject: RE: Undo with Table View and array controller
- From: Matt <email@hidden>
- Date: Fri, 22 Dec 2006 16:37:40 -0500
If you are going to try and insert objects at specific indexes back
into an array that has changed since then, you are going to have do
something special to get it all working correctly.
Ar you using the array controller itself to insertObjects:
atArrangedObjectsIndexes:? I haven't messed with undo on multiple
objects in a table view, but I would think that using the contoller
to insert objects wouldn't be a problem.
On Dec 22, 2006, at 6:27 AM, email@hidden wrote:
Problem: when the user removes a batch of entries, I do get the
removed
indexes, as well as an array of objects that were removed. I do a
prepareWithInvocation... on the undomanager, then call
insertObjects:atIndexes: which has the problem that the array
minus the
removed objects does not have those indexes anymore.
So how is this traditionally done? How do people calculate where
values should be added, especially in a code-free setting (i.e. when
bindings and the like are extensively used)?
I don't know, I've done it using code.
Finally a meta-question: does not undo lead to huge memory leaks?
A meta-answer: I don't know for sure but I'd always assumed that
the Undo
Manager retains the objects that are passed with the invocations,
and then
releases them when their invocations are removed from the undo and
redo
stacks.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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