Graphics Programs Reference
In-Depth Information
iPad users expect applications to work in all orientations, so add the following method to
both ItemsViewController.m and DetailViewController.m :
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)io
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
return YES;
} else {
return (io == UIInterfaceOrientationPortrait);
}
}
Build and run the application on both the iPhone and iPad (or their respective simulators).
Notice that rotating on the iPhone does nothing and rotating on the iPad rotates the view
of the view controller that is on the screen.
Now that Homepwner can run on the iPad, let's take advantage of some iPad-only ways to
present view controllers, starting with UIPopoverController .
Search WWH ::




Custom Search