aneuryzm
aneuryzm

Reputation: 64834

Why mainWindow is null if I invoke it from the menu?

I'm invoking the same IBAction from 2 different xib files (the main window and the main menu).

- (IBAction)showEditor:(id)sender
{
 ...    [document mainWindow]; 
}

However, mainWindow is null when I invoke showEditor from the menu. But i don't understand:bBoth xib files are initialized when the apps starts, so everything should be initialized when I click on the menu item.

thanks

Upvotes: 0

Views: 71

Answers (1)

Mundi
Mundi

Reputation: 80273

Maybe document is also null? That would explain why [document mainWindow] is null. See if your two instances of document are the same.

Upvotes: 1

Related Questions