Re: Tidy up before saving
Re: Tidy up before saving
- Subject: Re: Tidy up before saving
- From: Jim Graham <email@hidden>
- Date: Mon, 13 Aug 2007 19:07:32 +0100
Thanks Patrick
That was exactly what I needed. Only addition was an OrderOut to
ensure my sheet was closed before the save sheet displayed.
That was just one more of the "why didn't I think of that" episodes
that seem to be increasing in frequency as I get older, oh dear...
Thanks again
Jim
On 13 Aug 2007, at 15:38, PGM wrote:
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.
When you display a sheet, it indeed always returns immediately.
Therefore you have to pass a modalDelegate and a didEndSelector
when displaying the sheet. You can then call [super
saveDocument:nil] from within the didEndSelector. In that way first
your own sheet is displayed and only when it is dismissed, the
standard sheet.
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