gpt4 book ai didi

cocoa - NSOpenPanel 使应用程序卡住几秒钟

转载 作者:行者123 更新时间:2023-12-03 17:26:14 26 4
gpt4 key购买 nike

我以这种方式使用 NSOpenPanel:

    NSOpenPanel *op=[NSOpenPanel openPanel];
[op setDelegate:self];
[op setCanChooseFiles:YES];
[op setCanChooseDirectories:YES];
[op setAllowsMultipleSelection:YES];
[op setPrompt:NSLocalizedString(@"Scan this",@"button of 'scan folder' open panel")];
[op setAccessoryView:nil];
[op setMessage:@""];

if ( [op runModalForDirectory:nil file:nil] == NSOKButton )
{
[self scanPaths:[op filenames] automatic:NO];
[[ScanController sharedController] setCurrentScanSidebarDriveName: @"(Custom)"];
} else {
NSLog(@"cancel clicked");
}

当我单击“取消”时,应用程序运行到我的方法结束,然后卡住一段时间(几秒钟)。我认为我的这部分代码没问题。或不?当它掉落时,我的调试器会变得疯狂(At&T..)。 :/有什么办法可以调试这种问题吗?有人见过吗?谢谢。

最佳答案

当已暂停/处于待机状态的外部媒体需要一段时间才能重新启动时,我发现打开的面板会卡住应用程序几秒钟,但点击“取消”时却不会。您是否使用过 Instruments(Time Profiler)来了解此时它正在做什么?

关于cocoa - NSOpenPanel 使应用程序卡住几秒钟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4166016/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com