我在点击按钮时调用了以下代码。
NSOpenPanel *aPanel = [NSOpenPanel openPanel];
以上线冻结整个应用程序和内存从10 mb增加到2 gb并且增加。我添加了面板设置代码
NSOpenPanel *aPanel = [NSOpenPanel openPanel];
[aPanel setMessage: @"Choose folders";
[aPanel setPrompt:@"Select";
[aPanel setAllowsMultipleSelection:YES];
[aPanel setCanChooseDirectories:YES];
[aPanel setCanChooseFiles:NO];
[aPanel setCanChooseDirectories:YES];
我已经通过了
NSOpenPanel related memory questions
Why is NSOpenPanel/NSSavePanel showing memory leak?