NSSavePanel setDocumentURL in app's document folder

219 views Asked by At

I'm trying to set the directory url in an NSSavePanel so that it opens the panel to that directory but it doesn't work when the I set it to a path in my app's document folder.

NSSavePanel *panel = [NSSavePanel savePanel];
NSString *fileFolder = @"/Users/me/Library/Containers/com.company.app/Data/Documents/MyFolder";
NSURL *folderURL = [NSURL URLWithString:folder];
[panel setDirectoryURL:folderURL];

If I programmatically open the path using Finder it works so I don't understand why the path wouldn't work through NSSavePanel.

[[NSWorkspace sharedWorkspace] @"/Users/me/Library/Containers/com.company.app/Data/Documents/MyFolder" withApplication:@"Finder"];
0

There are 0 answers