Hi,
I'm writing an iPad app for my school, and I would like to make a custom view controller that controls the navigation of the user. I made a SwitchViewController class and added it to self.window in the app delegate. Then, in the Interface Builder, I added a view controller. I then added a view with an UIImage as the background. I then added a smaller view (583 x 964). I made an IBOutlet for that UIView, named it mainView. In the SwitchViewController file, I added these lines to viewDidLoad:
When I tried to run it, Xcode gave me "EXC_BAD_ACCESS" on the line [self.mainView insertSubview:grades.view atIndex:0]; . However, when I use one of apple's provided template for navigation (for example, tabBarController), there is no problem. Please help me out!
I'm writing an iPad app for my school, and I would like to make a custom view controller that controls the navigation of the user. I made a SwitchViewController class and added it to self.window in the app delegate. Then, in the Interface Builder, I added a view controller. I then added a view with an UIImage as the background. I then added a smaller view (583 x 964). I made an IBOutlet for that UIView, named it mainView. In the SwitchViewController file, I added these lines to viewDidLoad:
Code:
Grades_iPhone *tempGrades = [[Grades_iPhone alloc] initWithNibName:@"Grades_iPad" bundle:nil];
grades = tempGrades;
[tempGrades release];
[self.mainView insertSubview:grades.view atIndex:0];
When I tried to run it, Xcode gave me "EXC_BAD_ACCESS" on the line [self.mainView insertSubview:grades.view atIndex:0]; . However, when I use one of apple's provided template for navigation (for example, tabBarController), there is no problem. Please help me out!
Last edited by a moderator: