Can reviewUnsavedDocuments ever NOT be cancelled?
Can reviewUnsavedDocuments ever NOT be cancelled?
- Subject: Can reviewUnsavedDocuments ever NOT be cancelled?
- From: PGM <email@hidden>
- Date: Fri, 6 Jul 2007 23:20:32 -0400
Hey everybody,
I am currently busy implementing an Xcode-like behaviour when my app
quits with multiple dirty documents open. So instead of presenting
the user the standard "Review changes" dialog, I present a table with
all dirty documents so that the user can select all documents he
would like to save.
For this purpose I have subclassed NSDocumentController and overridden:
- (void)reviewUnsavedDocumentsWithAlertTitle:(NSString *)title
cancellable:(BOOL)cancellable delegate:(id)delegate
didReviewAllSelector:(SEL)didReviewAllSelector contextInfo:(void *)
contextInfo
However, I noticed that this function has quite a few behaviours that
do not match the documentation, and I would be happy if anybody tell
me whether the direction I have taken is correct.
- According to the documentation, "when the computer power is turned
off" the cancellable parameter should return NO. However, my own
logging always finds this parameter to be YES, even upon shutdown.
Should I anyways take this parameter into account? NSDocument
actually does not have any save... methods that are not cancellable,
so it would be handy if I could assume that there are actually no
situations an application can be quit without the user being able to
cancel.
-Second, according to the documentation, the didReviewAllSelector
should have the signature: (void)documentController:
(NSDocumentController *)docController didReviewAll: (BOOL)
didReviewAll contextInfo:(void *)contextInfo. However, when I log the
value that is passed, I get _docController:shouldTerminate: , so with
only two arguments instead of three. Does this matter for the
NSInvocation that I am using to invoke the callback?
-Third, the alertTitle that is passed does not bear any resemblance
to the default dialog that is shown.
I am a bit astounded that the documentation does not match my
observations for three out of the five arguments, so I start
wondering whether I am actually doing the correct thing by overriding
this method to get the desired behaviour.
Cheers, Patrick
_______________________________________________
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