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

Re: Re : Re: Saving while opening with NSDocument


  • Subject: Re: Re : Re: Saving while opening with NSDocument
  • From: Alto Test1 <email@hidden>
  • Date: Mon, 24 Mar 2014 13:22:08 -0400 (EDT)

Call me on my mobile.

From: email@hidden
To: email@hidden
To: email@hidden
Sent: Mon, Mar 24, 2014
Subject: Re: Re : Re: Saving while opening with NSDocument

Finally, I put the "saveDocument" in the "NIBDidLoad" method, with an "afterDelay:0". I was reluctant to use this "afterDelay:0" (I wish there were a method called "performOnNextRunLoop"). This smells like a hack !!! It was easier to call the "saveDocument" than to subclass NSDocumentController, and result is safer I think. I don't have to deal with the case where no nib is loaded. It works well. Thanks to all for their help. Colas Le Mercredi 19 mars 2014 23h14, Colas B <email@hidden> a écrit : Thanks for this very complete answer. If it can help, I can tell that I also tried to put the 'saveDocument:' in the 'didLoadNIb' (without the 'afterDelay') and it also create deadlock. ________________________________ From: Quincey Morris <email@hidden>; To: Colas B <email@hidden>; Cc: email@hidden <email@hidden>; Subject: Re: Saving while opening with NSDocument Sent: Wed, Mar 19, 2014 10:09:54 PM On Mar 19, 2014, at 14:10 , Colas B <email@hidden> wrote: > I will try with 'withDelay:0' and will let you know if it works. If you have a link for information on runloops (what is it, how it works, etc.), I am interested. You can get information on run loops here:     https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Multithreading/Introduction/Introduction.html and in the NSRunLoop class reference:     https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSRunLoop_Class/Reference/Reference.html However, just as it?s not about the time delay, it?s also not exactly about the run loop. Conceptually, the ?top level? of app processing is a loop in the main thread:     1. Get the next event or source.     2. Process it.     3. Repeat forever from step 1. When you open a document, the ?openDocument:? action method is going to be invoked somewhere in an instance of step 2. Generally, it?s not ?safe? to invoke another action method, such as ?saveDocument:? until the current one is finished execut
_______________________________________________

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: 
 >Re: Re : Re: Saving while opening with NSDocument (From: Colas B <email@hidden>)

  • Prev by Date: Re: Re : Re: Saving while opening with NSDocument
  • Next by Date: Re: Re : Re: Saving while opening with NSDocument
  • Previous by thread: Re: Re : Re: Saving while opening with NSDocument
  • Next by thread: Re: Re : Re: Saving while opening with NSDocument
  • Index(es):
    • Date
    • Thread