NSSavePanel runModal falls under a mountain lion

they have a document-based application that runs under the lion, but not under the mountain lion.

I subclassed AppDelegate to open SavePanel when I first started the application, if there was no recent document to create a new named document. This is due to the fact that the user should not work with a document without a name. So I changed applicationShouldOpenUntitledFile to call my doSaveAs method when its recent DocumentmentURL was not found.

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

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

Can anybody help me?

Hi

Klaus

+6
source share
2 answers

I also had this problem. The point is that this is not a crash, it is the C ++ exception that Apple left there, and the Xcode debugger gets to the breakpoint of the exception.

What you need to do is change the breakpoint of the exception from all exceptions for all Objective-C exceptions only.

This is displayed on the Breakpoints tab on the left in Xcode.

+9
source

You probably don't open the dialog in the main thread. Move the code or use performSelectorOnMainThread .

0
source

Source: https://habr.com/ru/post/924344/


All Articles