Re: Preventing Document from closing
Re: Preventing Document from closing
- Subject: Re: Preventing Document from closing
- From: Markus Spoettl <email@hidden>
- Date: Sat, 04 Apr 2015 12:49:15 +0200
Hi Quincey,
On 04/04/15 10:16, Quincey Morris wrote:
[...]
[..life saving code snipped..]
[...]
The first branch of the ‘if’ statement is the code you want, that prevents the
document from closing. Note that it doesn’t involve a separate method. Rather,
it just invokes the supplied selector but changes one of the parameters to NO.
The else branch is the code you would use if you wanted to have to document do
something before actually closing the document. In my case, I wanted to invoke a
‘willClose’ method first. The reason this part is so much more complicated is
that it hasn’t been determined yet whether the document *will* close — that
doesn’t happen until the supplied selector is invoked. So, my own method’s
selector replaces the supplied selector in the ‘super’ invocation, and my method
invokes the originally supplies selector when it’s done messing around.
Hope that makes sense. It *is* a little confusing. :)
It does and it's perfect! Thanks so much Quincey! This list would be in much
trouble without you - at least I would be!
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