Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSSavePanel runModal crashes under Mountain lion

Tags:

objective-c

ich have a document based app which works under lion but not under mountain lion.

I have subclassed the AppDelegate to open a SavePanel on first app start, if no recent document is available to create a new named document. This is because the user should not work with an untitled document. So I changed the applicationShouldOpenUntitledFile to call my Method doSaveAs when no recentDocumentURL its found.

- (BOOL)doSaveAs 
{   
   NSLog(@"doSaveAs");  
    NSSavePanel *tvarNSSavePanelObj = [NSSavePanel savePanel];
    NSUInteger tvarInt  = [tvarNSSavePanelObj runModal];

Under ML it crashes without any console output. The crash appears in Thread 8 "Quicklook.pluginload" if that helps?

Can anyone help me ?

Regards

Claus

like image 379
Thallius Avatar asked Sep 01 '12 14:09

Thallius


1 Answers

I had this problem too. The thing is, it's not a crash, it's a C++ exception that Apple left in there, and the Xcode debugger is hitting an exception breakpoint.

What you need to do is change your exception breakpoint from All Exceptions to just All Objective-C Exceptions.

This appears in the Breakpoints tab on the left in Xcode.

like image 159
Sam Washburn Avatar answered Sep 26 '22 00:09

Sam Washburn