Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

aarontcan

macrumors newbie
Original poster
Jun 16, 2011
1
0
How do you activate the tilt function in Xcode 4? In other words, how do you allow it to switch its orientation from portrait to landscape when you tilt the device/simulator? The attributes tab in Interface Builder does not allow me to alter it from "portrait", and when I open the simulator and tilt the device to the left or right it stays locked in the portrait view.
 
When u click on your Target after you clicked on your project on the upper left.
U can tell him what Orientations to Support. next up is to change the

Code:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

This returns only Portrait mode.
if you just return YES. It should flip all the time when u switch.

(in every viewController u need.)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.