On Jun 28, 2010, at 12:33 , Mike Abdullah wrote:

> 
> On 27 Jun 2010, at 00:01, Guillaume Laurent wrote:
> 
>> Hi all,
>> 
>> I'm having difficulties with the undo/redo mechanism and my Core Data 
>> objects. The problem is that I create a CoreData object (say a rectangle), 
>> then set some of its attributes according to some controls values (the 
>> position and size of a CALayer the user has just created in a view). This 
>> set of actions is a single one from the user's point of view. I know I can 
>> make it appear so with NSUndoManager:beginUndoGrouping/endUndoGrouping. But 
>> when I undo this in the app, each of the steps of the object's creation are 
>> undone seperately, including the setting of each of the attributes.
> 
> Alarm bells going off here. Even if Core Data wasn't coalescing these changes 
> into one undo operation, NSUndoManager should do it for you with the 
> groups-by-event behaviour. Have you turned this off by any chance?

No, I didn't. As I said, the problem is that grouping only means that one 
'undo' request will result in several undo actions internally. So undoing the 
creation of a new CoreData Rectangle object (that is, pressing Cmd-Z) results 
in several actions : one per each initial parameter setting, and then one for 
the object creation itself.

--
Guillaume
http://telegraph-road.org





_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to