I am trying to display an NSPopover in a mac application when the window opens to give the user an instruction, but the popover will not display.
If I call the exact same function from a button press then the popover successfully displays, but when I call it in windowDidLoad it doesn't.
I can see that the control I am presenting it from has a bounds, so I don't think that is the problem. I've also checked that the behaviour of the popover is not transient, so it shouldn't close without intervention.
In my function I'm passing some variables into a custom initialiser, but it is basically just this:
CustomViewController *instruction = [[CustomViewController alloc] init];
[instruction.popover showRelativeToRect:[aField bounds] ofView:aField preferredEdge:NSMaxXEdge];
The init method simply calls the following, and the custom view and controller are hooked up in the NIB.
[super initWithNibName:@"InstructionalView" bundle:nil]
Has anyone come accross this?