• 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: Saving while opening with NSDocument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving while opening with NSDocument


  • Subject: Re: Saving while opening with NSDocument
  • From: Quincey Morris <email@hidden>
  • Date: Wed, 19 Mar 2014 09:43:24 -0700

On Mar 19, 2014, at 04:30 , Colas B <email@hidden> wrote:

> I will look in the direction of ‘performSelector’ if (when) I want to save these initial data repairings. Another possible issue might be that the delay is not long enough and the `saveDocument:` creates a deadlock. This is an unlikely situation if the delay is 10 seconds. Is there a way to detect when we are in such a situation?

I’d suggest you do it (with a delay of 0) in an override of -[NSDocument windowControllerDidLoadNib:]. At that point, the NSDocument initialization process is basically over, as is the work of opening the document window (which likely involves disk accesses to read the NIB file).

Note that the point of using ‘performSelector:’ here is not to have a time delay, but to defer the performed action until the next iteration of the run loop, at which point the possibility of your deadlock no longer exists.

_______________________________________________

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


  • Follow-Ups:
    • Re: Saving while opening with NSDocument
      • From: Kyle Sluder <email@hidden>
References: 
 >Saving while opening with NSDocument (From: Colas B <email@hidden>)
 >Re: Saving while opening with NSDocument (From: Quincey Morris <email@hidden>)
 >Re: Saving while opening with NSDocument (From: Colas B <email@hidden>)

  • Prev by Date: Re: Best way to composite/tile multiple CGImages to one image
  • Next by Date: Re: Saving while opening with NSDocument
  • Previous by thread: Re: Saving while opening with NSDocument
  • Next by thread: Re: Saving while opening with NSDocument
  • Index(es):
    • Date
    • Thread