Leopard Crashing in Open and Save Panels (solved?)
Leopard Crashing in Open and Save Panels (solved?)
- Subject: Leopard Crashing in Open and Save Panels (solved?)
- From: John Nairn <email@hidden>
- Date: Tue, 4 Dec 2007 12:32:16 -0800
The following method would crash frequently in Leopard although it
never crashed in past 5 years before Leopard.
// save copy to results file
- (IBAction)exportXMLCommands:(id)sender
{
NSSavePanel *pan = [NSSavePanel savePanel];
[pan beginSheetForDirectory:nil file:nil
modalForWindow:[self window] modalDelegate:self
didEndSelector:@selector(exportXMLPanelDidEnd:returnCode:contextInfo:)
contextInfo:nil];
}
// if OK, sav text in new file
- (void)exportXMLPanelDidEnd:(NSSavePanel *)sheet returnCode:
(int)returnCode
contextInfo:(void *)contextInfo
{
}
It would crash in the NSSavePanel method soon after the sheet opened
and before returning to my code.
The crashes have stopped by retaining the panel in the first method
NSSavePanel *pan = [[NSSavePanel savePanel] retain];
and releasing when the sheet is finished.
[sheet release];
I am wondering if the new garbage collection in Leopard has caused
this problem? My project is set to "unsupported" for garbage collect,
but does that stop Cocoa objects themselves from using it?
Furthermore, I have seen crashes in the open panel which is handled
entirely by the NSDocument class. Since there is no panel for me to
retain, what would be a good solution for those crashes?
---------------
John Nairn (1-541-737-4265, FAX:1-541-737-3385)
Professor and Richardson Chair
Web Page: http://woodscience.oregonstate.edu/faculty/Nairn
FEA/MPM Web Page: http://oregonstate.edu/~nairnj
_______________________________________________
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