I am building sandboxed OS X app (OS X 10.10.5, Xcode 6.4). In the course of execution I open NSOpenPanel object. Then I run next snippet:
NSString* s=[@"~" stringByExpandingTildeInPath];
NSOpenPanel* panel = [NSOpenPanel openPanel];
[panel setCanChooseDirectories:YES];
[panel setCanChooseFiles:NO];
NSURL* url=[NSURL fileURLWithPath:s];
if(url){
[panel setDirectoryURL:url];
}
[panel setAllowsMultipleSelection:YES];
[panel beginSheetModalForWindow:[self.outlineView window]completionHandler:^(NSInteger result) {}
My expectation is that panel opens in directory /Users/xxx/Library/Containers/com.123456.App/
Instead that the panel opens in directory /Users/xxx
Application is actually built and deployed into directory /Users/xxx/Library/Containers/com.123456.App/Data/
While debugging I observe that at this point:
if(url){
[panel setDirectoryURL:url];
}
url contains correct value: file:///Users/xxx/Library/Containers/com.123456.App/Data/
Any idea?