NavigationBar Based Application Development Including One Open GL View: How?
My question starts with a problem:
I started a project in Xcode: a navigation bar based on one (with a TableView). Then I added some views via IB or programmatically ... which works great.
Then I decided to write my own ViewClass inherited from UIView called OpenGlView (based on the view provided by the underlying OpenGlES project in XCode) and that OpenGlViewController
(inherited from UIViewController
).
This works fine until I try to push the view controller to my navBar: then I get "EXC__ BAD __ACCESS" . I can't figure out why this is ok with any view, but the one used to display OpenGL content ...
And I really have no idea how I manage to develop a NavBar based application including a View displaying OpenGL content ... any idea?
(I also tried adding OpenGlView
as a subView of the base UIView
one previously added to the NavigationBar, but I got the same error).
In the RootController:
OpenGlViewController *glvController;
if (glvController == nil)
{
glvController = [[OpenGlViewController alloc] initWithNibName:@"Gl View" bundle:nil];
glvController.title = @"GL View";
}
[self.navigationController pushViewController:glvController animated:YES];
in OpenGlViewController:
- (void)loadView {
OpenGlView * view;
view = [[OpenGlView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
self.view = view;
[view release];
}
source to share