Cocoa Sandbox: How to Get Permission to Write Multiple Files or to a Directory Using NSSavePanel

So, NSSavePanel currently returns the URL of the file with the extension, and your application has permission to write to this file.

Is there a way to allow the user to select a directory for recording? For example, if an application exports several images at once, the names will not be predefined by the user.

+6
source share
1 answer

You need NSOpenPanel.

NSOpenPanel * openPanel = [NSOpenPanel openPanel]; [openPanel setCanChooseFiles:NO]; [openPanel setCanChooseDirectories:YES]; [openPanel setAllowsMultipleSelection:NO]; 
+2
source

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


All Articles