I have an NSOpenPanel
Where I can select directory or multiply files (single file as well).
However some evil spirits took over my app when I press OK button on the panel.
If I pick less than 10 files the NSOpenPanel
doesn't close immediately however when I pick 11 or more it does. Perhaps those spirits are afraid of large amounts of files...
Here is how I Implemented the routine:
NSOpenPanel *panel = [NSOpenPanel openPanel];
[panel setCanChooseFiles:YES];
[panel setCanChooseDirectories:YES];
[panel setAllowsMultipleSelection:YES];
[panel setTitle:@"Open/Add"];
NSInteger clicked = [panel runModal];
if (clicked == NSFileHandlingPanelOKButton)
{
NSArray * urls = [panel URLs];
[panel orderOut:[self window]];
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void)
{
//My routine here
});
Do you have any ideas ? or perhaps you know a good exorcist?! Of course I want it to close immediately!
P.S. I also tried to dispatch after some period of time -> same behaviour