NSOpenPanel を使用してアプリケーションにフォルダーを設定していますが、これをフォルダー「file://localhost/Users/juan/」のパスとして取得しています
これは私のコードです:
NSOpenPanel * setDirectory = [NSOpenPanel openPanel];
setDirectory.canChooseFiles=NO;
setDirectory.canCreateDirectories=YES;
setDirectory.canChooseDirectories=YES;
setDirectory.directoryURL=_path;
[setDirectory beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) {
NSLog(@" results %ld", result);
if (NSFileHandlingPanelCancelButton){
NSLog(@"cancel");
}
if (NSFileHandlingPanelOKButton) {
self.path = [[setDirectory URLs] objectAtIndex:0];
}
}];
}
私の質問は、file://localhost なしで「/Users/juan/Desktop/」などの絶対パスを取得するために、どのように、または何をする必要があるかです。
私は本当にポインタに感謝します。