So I have an app where I'm implementing a universal tool bar that sort of acts like a tab bar + tool bar and is featured on all of my view controllers. I have a custom tool bar that has some buttons that manipulate some navigational view controllers I've created in the App Delegate. However, I am having trouble getting these buttons to work, below is an example of an action method for one of the buttons I'm using:
Test_ClassAppDelegate *test_ClassAppDelegate = (Test_ClassAppDelegate*)[[UIApplication sharedApplication] delegate];
[[[test_ClassAppDelegate window] superview] removeFromSuperview];
[[test_ClassAppDelegate window] addSubview:[[test_ClassAppDelegate helpNavController]view]];
[test_ClassAppDelegate release];
I think the main area I might be going wrong is in my second line where I'm removing my superview. I'm not even sure if this is the correct way to go about doing that. I know I could implement this code in the app delegate itself, but am curious is there anyway to remove the superview from else where, or if anyone else sees any problems with this code. Thanks.