3
  • I create a new macOS app in XCode.

  • I add the entitlement com.apple.security.files.user-selected.read-write with value YES (to allow usage of NSSavePanel)

  • In AppDelegate.m, I implement applicationDidFinishLaunching as follows:

    - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
      NSSavePanel* nssavepanel = [NSSavePanel savePanel];
      NSButton* nsbutton = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 50, 20)];
      [nsbutton setTitle:@"Button title"];
      [nssavepanel setAccessoryView:[[NSView alloc] initWithFrame:NSMakeRect(0, 0, 200, 80)]];
      [[nssavepanel accessoryView] addSubview:nsbutton];
      [nssavepanel beginWithCompletionHandler:^(NSModalResponse result) {}];
    }
    

When I start the application, I see a panel with a button.

On macOS 10.15.3, I can click the button in the acceessory view.

On macOS 11.0 Beta (20A4300b), I cannot click the button -- the whole accessory view seems to be disabled. (If I use runModal or beginSheetModalForWindow instead of beginWithCompletionHandler, the accessory view works as expected.) Is this a bug? Am I doing something wrong here?

phimuemue
  • 34,669
  • 9
  • 84
  • 115
  • 1
    Just FYI - it's fixed in the 20A5323l – zrzka Jul 23 '20 at 14:39
  • @zrzka I just tried with 20A5323l, and the error persists. Did you try it as well/do you have a credible source that Apple fixed it and it should work? – phimuemue Jul 27 '20 at 11:25
  • I tested it on < beta 3 (doesn't work) and on beta 3 = 20A5323l (does work). Your code copy & pasted + added target/action (works without it as well) - check [the screenshot](https://cln.sh/3UO9Zj). – zrzka Jul 27 '20 at 11:42
  • Thanks for your effort, and it looks the same on my machine, but I *cannot click* the button. If I set focus to the "tags" combobox, the button/accessory view seems to be unlocked, but before that, it does not respond to my clicks. – phimuemue Jul 27 '20 at 12:09
  • The error persists in macOS Big Sur 11.0.1 Beta (20B5022a). – phimuemue Nov 09 '20 at 10:53

0 Answers0