You ask, can you do this for your application or block orientation for the device itself? It seems you are asking for the latter, and I must ask why you want to do this. It is not possible to block the orientation of the device, as it will be locked in portrait mode for other applications.
However, you can only support orientations that you want yourself. Many applications only support portrait mode, and games usually only support landscape.
XCode. viewcontroller.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
, .