Graphics Programs Reference
In-Depth Information
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
return YES;
return io == UIInterfaceOrientationPortrait;
}
Build and run the application. You should be able to rotate to landscape mode and, after
the web service request finishes, see the list of posts on the lefthand side.
But we're not done yet. If you tap a row in the list view controller, the web view control-
ler won't appear in the detail panel like you want. Instead, it is pushed onto the master
panel and replaces the list view controller. To address this problem, when a row is tapped,
we need to check if the ListViewController is a member of a split view controller
and, if it is, take a different action.
You can send the message splitViewController to any UIViewController ,
and if that view controller is part of a split view controller, it will return a pointer to the
split view controller ( Figure 26.3 ). Otherwise, it returns nil . View controllers are smart:
a view controller will return this pointer if it is a member of the split view controller's ar-
ray or if it belongs to another controller that is a member of a split view controller's array
(as is the case with both ListViewController and WebViewController ).
Figure 26.3 UIViewController's splitViewController property
 
Search WWH ::




Custom Search