On 19/12/2009, at 4:34 PM, Gerriet M. Denkmann wrote:

> The documentation says: "Beginning with Mac OS X v10.4 the result of this 
> method is deferred until the next iteration of the runloop"
> []


> Maybe GCUndoManager could implement:
> - (void)setActionNameToBeUsedAtTheNextNonEmptyNamelessUndo: (NSString 
> *)actionName;
> - or something like that with a slightly shorter name.


Christ on a bike. ;-)

This is exactly the sort of trashy limitations that you occasionally run into. 
I'm guessing that the reason that Core Data apps don't allow you to set the 
action name is because there's no sane way to do it with the current UM design, 
so they just don't attempt it.

A solution might be to allow the undo manager to take a delegate, and when it 
is ready to submit a task, it asks its delegate for a suitable action name. The 
problem then is, how can it inform the delegate which (deferred) task it is 
actually asking for the name of, on the basis that several could be submitted 
at once. Perhaps it doesn't matter, and it will always be "whatever was last 
done", from the user's perspective.

You might be able to make this work by subscribing to one the UM's 
notifications, such as a group open or close, and setting the name then. Since 
a group has to be opened to store the task(s) that are submitted, whenever that 
is, this should be synchronised with the real but deferred activity.

--Graham


_______________________________________________

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