Tidy up before saving
Tidy up before saving
- Subject: Tidy up before saving
- From: Jim Graham <email@hidden>
- Date: Mon, 13 Aug 2007 12:06:42 +0100
A newbie question. I have a document based app where I would like to
give the user the choice to "tidy up" a few things before saving. I
have put a call to a method,"tidyUpWanted" in "saveDocument" and
"saveDocumentAs". This method displays an alert and depending on the
answer either returns YES or NO and the appropriate action carried
out. The save sheet is then displayed and the document saved.
-(IBAction)saveDocument:(id)sender
{
if ([self tidyUpWanted])
{
[self doTidyUp];
}
[super saveDocument:sender];
}
This works fine if I display the Alert using "runModal" but if I
display the alert as a sheet then the save sheet never gets displayed.
Use of NSLog in "saveDocument" shows that this method is not returned
to until the dialog is dismissed when runModal is used but is
returned to immediately the sheet is displayed. So effectively my app
is then trying to display the save sheet at the same time as my
sheet is up.
As it is a document based app I would prefer to have the alert as a
sheet attached to it's document any help would be appreciated.
Cheers
Jim Graham
_______________________________________________
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