Preventing Document from closing
Preventing Document from closing
- Subject: Preventing Document from closing
- From: Markus Spoettl <email@hidden>
- Date: Sat, 04 Apr 2015 09:07:58 +0200
Hi,
in an NSDocument based application, is there a reliable way to prevent a
document from closing and the app itself from terminating?
I'm having a very difficult time understanding now
-canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo: is supposed to
work. Contrary to the documentation, the selector that is passed in is this
_something:didSomething:soContinue:
and not as the documentation indicates
document:shouldClose:contextInfo:
Every time I try to make sense of this and the header comments, my head starts
spinning.
Some background: In some circumstances, my app needs to update the model in a
background task to get its data into a consistent state after some other model
properties change. When this happens, I want to prevent the app from terminating
and the document from being closed.
I don't want to debate whether this is a good idea/good design or not (I know I
could serialize the background task states and restart when the app restarts
them but I really really really don't want to do that), I would like to know if
there's a reliable way to prevent document closure.
Thanks for any suggestions!
Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________
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