Hello I have a view which is shown when a button is pressed this works fine, if I open a second window the view works fine and I can go back the prior window and use the view as I have used removeFromSuperview.
My problem is however if I close the last opened window the view no longer works on the first window, however if I open a new window it works on the first window again.
How do I get the view to continue working when one of the windows have been closed?
Thanks for your help!
Here is the code I am using:
-(IBAction) ShowView:(id) sender{
[myView setHidden:FALSE];
if ([myView isInFullScreenMode]){
[myView exitFullScreenModeWithOptions:nil];
}
else{
[myView enterFullScreenMode:[[myView window] screen] withOptions:nil];
for (NSView *view in [NSArray arrayWithArray:[myView subviews]]){
[view removeFromSuperview];
[myView addSubview:view];
}
}
}