The following code is in my "switchviewcontroller.m" file
- (void)viewDidLoad {
MainView *mainController=[[MainView alloc]
initWithNibName:@"Blue View" bundle:nil];
self.mainViewController=mainController;
[self.view insertSubview: mainController atIndex:0];
[mainController release];
[super viewDidLoad];
}
All I am trying to do here is load this view "main" into the view in my mainwindow.
The code just gives a warning and compiles, but when it executes it crashes on the line in warning
//80: warning: incompatible Objective-C types 'struct MainView *', expected 'struct UIView *' when //passing argument 1 of 'insertSubview:atIndex:' from distinct Objective-C type
[self.view insertSubview: mainController atIndex:0];