• 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: Crash when move open document based app file to trash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash when move open document based app file to trash


  • Subject: Re: Crash when move open document based app file to trash
  • From: Martin Wierschin <email@hidden>
  • Date: Wed, 15 Apr 2015 18:51:47 -0700

>> I’m not sure how careful that monitoring is, though, whether it happens continuously, or only at the moment the app or document regains focus.
>
> Even if it’s continuous, it can’t be continuous enough, since the OS is multithreaded. There’s always the possibility of a race condition where the app tries to access the file after it’s been moved but before the notification arrives.

I believe an app can use -[NSDocument performSynchronousFileAccessUsingBlock:] to avoid such race conditions. At least, I assume so, since NSDocument adopts NSFilePresenter and should cope with access from multiple processes (eg: Jonathan's app and the Finder).

~Martin Wierschin


_______________________________________________

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: 
 >Crash when move open document based app file to trash (From: Jonathan Mitchell <email@hidden>)
 >Re: Crash when move open document based app file to trash (From: Mike Abdullah <email@hidden>)
 >Re: Crash when move open document based app file to trash (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: User interface unresponsive in window
  • Next by Date: Re: Master - Detail: How to get back?
  • Previous by thread: Re: Crash when move open document based app file to trash
  • Next by thread: UTI case doesn't matter sometimes?
  • Index(es):
    • Date
    • Thread