NSOpenPanel hangs when using -panel:shouldEnableURL

Originator:nos1350
Number:rdar://14392773 Date Originated:
Status: Resolved:
Product:OSX SDK Product Version:10.9
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary: 
NSOpenPanel hangs when the application is sandboxed, canChooseDirectories is set to YES, and the delegate is using -panel:shouldEnableURL:

Steps to Reproduce: 
1. Create a new project in Xcode
2. Sandbox the application with user selected file read/write access
3. Set the AppDelegate to conform to the NSOpenSavePanelDelegate
4. Open the MainMenu.xib and add a button linked to the action chooseFolder: as follows:
- (IBAction)chooseFolder:(id)sender {
   NSOpenPanel *openPanel = [NSOpenPanel openPanel];

   [openPanel setCanChooseDirectories:YES];
   [openPanel setDelegate:self];

    [openPanel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) {
       NSLog(@"Finished");
    }];
}
5. Add the -panel:shouldEnableURL: delegate method as follows:
-(BOOL)panel:(id)sender shouldEnableURL:(NSURL *)url{
   return YES;
}
6. Run the application and click the button to open the panel.

Expected Results:  The panel to open and allow me to select a directory

Actual Results: The application will hang.

Regression:

Notes: -panel:shouldEnableURL: is never called when the application hangs, the CPU doesn't appear to spike.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!