I am very-much new to the iphone programming. I want to swap the view of a UIViewController as the iphone rotates. I have these methods implementd in my view controller. i get syntax error in the line "self.view = landscapeView".
- (BOOL)shouldAutorotateToInterfaceOrientation
UIInterfaceOrientation)interfaceOrientation {
return YES;// for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
-(void)willRotateToInterfaceOrientation
UIInterfaceOrientation)toInterfaceOrientation duration
NSTimeInterval)duration
{
[super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
self.view = landscapeView;
}
if (toInterfaceOrientation == UIInterfaceOrientationPortrait)
{
self.view = portraitView;
}
}
- (BOOL)shouldAutorotateToInterfaceOrientation
return YES;// for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
-(void)willRotateToInterfaceOrientation
{
[super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
self.view = landscapeView;
}
if (toInterfaceOrientation == UIInterfaceOrientationPortrait)
{
self.view = portraitView;
}
}