문제

In several of my projects I am using the following code:

NSOpenPanel * ProfilOpenPanel = [NSOpenPanel openPanel];
[ProfilOpenPanel setCanChooseFiles:YES];
[ProfilOpenPanel setCanChooseDirectories:NO];
[ProfilOpenPanel setAllowsMultipleSelection:YES];
[ProfilOpenPanel setAllowedFileTypes:[NSArray arrayWithObject:@"txt"]];
int antwort=[ProfilOpenPanel runModal];

Since upgrading to 10.8 and Xcode4.5, this code doesn’t work any more. The panel opens, but then the app crashes with a message in the Debug Navigator as: quicklook.pluginload(serial) 1 Thread Thread 5 14 _pthread_wqthread

In the console, a couple of warnings appear: WindowServer: CGXDeferSurfaces: Invalid source window 19938 and another warning: 28.September.12 12:10:40.001 Xcode[78227]: [MT] DVTAssertions: Warning in /SourceCache/IDEKit/IDEKit-1854/Framework/Classes/Editor/IDEEditorContext.m:617 Details: Lost history for x-xcode-disassembly://stack_frame? processID=31774&threadID=12&frameID=0 Object: Method: -_greatestDocumentAncestorWasForgotten Thread: {name = (null), num = 1} Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.

도움이 되었습니까?

해결책

Disabling my exception breakpoint in xcode worked for me. Or try just disabling all breakpoints.

Source: answer to the same poster on a blog at http://cyborgdino.com/2012/02/nsopenpanel-displaying-a-file-open-dialog-in-os-x-10-7/#comment-702

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top