Horizontal Applications
Depending on the kind of applications you make, you may find that you will need to implement some in a horizontal view rather than a vertical view, this can help you display data that is traditionally made for viewing on a landscape interface (such as musical notation). There are a couple of hurdles you will have to jump across to make perfect horizontal views, but once you get it working the first time its doubtful it will cause you problems in the future. So first things first, open up Interface Builder and navigate to your view, there you will see a window that looks something like this:
![]()
Notice how there is a curving arrow towards the top right? Click it and it will rotate your view to be horizontal/vertical as shown in Interface Builder. Now theoretically that's all we should really need to do, but the fun doesn't stop there, we have to insert some code into our application. Locate the function applicationDidFinishLaunching in your AppDelegate class and inside add the following code:
[application setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];
This changes the application to landscape when it launches. Try it out though, and you'll notice 1 tiny problem with it, it rotates the view after the application has been launched. So how do we get our application to launch automatically using the landscape view? We need to go into our Info.plist file and add a variable:
<key>UIInterfaceOrientation</key> <string>UIInterfaceOrientationLandscapeRight</string>
Now our application starts in landscape mode, and we can put this problem to bed.