Presenting the open panel to the user

来源:互联网 发布:windows10风扇控制软件 编辑:程序博客网 时间:2024/05/16 15:23
- (IBAction)openExistingDocument:(id)sender {   NSOpenPanel* panel = [NSOpenPanel openPanel];   // This method displays the panel and returns immediately.   // The completion handler is called when the user selects an   // item or cancels the panel.   [panel beginWithCompletionHandler:^(NSInteger result){      if (result == NSFileHandlingPanelOKButton) {         NSURL*  theDoc = [[panel URLs] objectAtIndex:0];         // Open  the document.      }}]; }

0 0
原创粉丝点击