6. When making first view controller as landscape

When we make games, usually we go for landscape orientation. So if you have selected the project template as “View based Application”, Interface builder automatically creates ViewController in Portrait mode for you, which you can make as landscape by clicking on top right “arrow” icon in view controller xib at Interface builder. But still you don’t see exact behavior on simulator when you run the app, it shows you misplaced view.

To avoid this problem you just need to change your “shouldAutorotateToInterfaceOrientation” method as follows:

– (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight)||(interfaceOrientation == UIInterfaceOrientationLandscapeLeft);

Thats it!