Open NSPopover in WindowDidLoad

I am trying to display NSPopover in a mac application when opening a window to give the user an instruction, but the popover will not be displayed.

If I call the same function with the click of a button, the popup will be displayed successfully, but when I call it in windowDidLoad, it is not.

I see that the control that I present to them has boundaries, so I don’t think this is a problem. I also verified that the popover behavior is not transient, so it should not be closed without intervention.

In my function, I pass some variables to the user initializer, but basically this:

CustomViewController *instruction = [[CustomViewController alloc] init];
[instruction.popover showRelativeToRect:[aField bounds] ofView:aField preferredEdge:NSMaxXEdge];

The init method simply calls the following, and the user view and controller connect to the NIB.

[super initWithNibName:@"InstructionalView" bundle:nil]

Does anyone come to this?

0
1

CustomViewController, popover nib ( alloc init).

loadView, :

[instruction loadView];

, "instruction.popover" , .

0

All Articles