Question...
I’ve previously used this code from my MainMenu.xib to manage windows:
--
if([olt_MainMenu_WINDOW isVisible]){
[olt_MainMenu_WINDOW setReleasedWhenClosed:NO];
[olt_MainMenu_WINDOW close];
}
...and then
if(olt_DoSomething_WINDOW == nil)
if(![[NSBundle mainBundle] loadNibNamed:@"DoSomething" owner:self topLevelObjects:nil])
NSBeep();
if(olt_DoSomething_WINDOW != nil)
[olt_DoSomething_WINDOW makeKeyAndOrderFront:nil];
--
...then go back to my window in my MainMenu.xib:
--
if([olt_DoSomething_WINDOW isVisible]){
[olt_DoSomething_WINDOW setReleasedWhenClosed:NO];
[olt_DoSomething_WINDOW close];
}
...and then
if(olt_MainMenu_WINDOW == nil)
if(![[NSBundle mainBundle] loadNibNamed:@"MainMenu" owner:self topLevelObjects:nil])
NSBeep();
if(olt_MainMenu_WINDOW != nil)
[olt_MainMenu_WINDOW makeKeyAndOrderFront:nil];
--
but if I try to makeKeyAndOrderFront the DoSomething window a second time, it barfs with exc_bad_access (code=1 ...
I can makeKeyAndOrderFront the MainMenu more than once but not any others. What am I missing?
Yes, 'Release When Closed’ is not selected in the Attributes inspector for the window. This is the first time I've used this with ARC, could it be related to that?