// Create and configure the panel. NSOpenPanel* panel = [NSOpenPanel openPanel]; [panel setCanChooseDirectories:NO]; [panel setAllowsMultipleSelection:NO]; [panel setMessage:@"Import one or more files or directories."]; // Display the panel attached to the document's window. [panel beginSheetModalForWindow:window completionHandler:^(NSInteger result){ if (result == NSFileHandlingPanelOKButton) { //点击确定后的代码
...
}
}];