On Mar 19, 2014, at 04:30 , Colas B <colasj...@yahoo.fr> 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 (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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com