I create a new macOS app in XCode.
I add the entitlement
com.apple.security.files.user-selected.read-write
with valueYES
(to allow usage ofNSSavePanel
)In
AppDelegate.m
, I implementapplicationDidFinishLaunching
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?