• 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: NSUndoManager auto-grouping?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSUndoManager auto-grouping?


  • Subject: Re: NSUndoManager auto-grouping?
  • From: Kyle Sluder <email@hidden>
  • Date: Tue, 15 Dec 2009 14:17:30 -0800

On Sat, Dec 12, 2009 at 12:16 PM, Scott Squires <email@hidden> wrote:
> Same basic setup for a number of routines, however certain types of routines
> seem to be automatically be grouped.

Have you read the documentation for per-event grouping?

> I have some image processing routines that are on another thread and undo
> objects are created.

Have you read the documentation about how multithreading and
NSUndoManager really don't mix?  <grin>
http://developer.apple.com/mac/library/DOCUMENTATION/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/ThreadSafetySummary.html#//apple_ref/doc/uid/10000057i-CH12-122647-BBCCEGFF

Are you, in fact, running image processing routines in the background
and expecting them to add undo groups when they're completed? Surely
you can't expect this to make sense; the order in which they wind up
on the undo stack (even if it were thread safe) is indeterministic,
making undo almost useless.

Or are the operations simply internally parallelized? In that case,
the threads should coordinate amongst themselves, perhaps locking
around a shared undo manager.  Alternatively, you could have a serial
GCD queue, and as your work units finish they could enqueue blocks
that themselves register undo events.

(And we should file bug reports to see a block-based API for NSUndoManager…)

--Kyle Sluder
_______________________________________________

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

References: 
 >NSUndoManager auto-grouping? (From: Scott Squires <email@hidden>)

  • Prev by Date: Re: Setting the port of an NSURL
  • Next by Date: Re: [iPhone] Sample code for live camera stream?
  • Previous by thread: NSUndoManager auto-grouping?
  • Next by thread: Re: NSUndoManager auto-grouping?
  • Index(es):
    • Date
    • Thread