Sometimes after upgrading your Xcode and iPhone SDK installation you may see the alert “Base SDK missing” when you try to compile and build an old project (that was written with a previous version of Xcode and an older version of iPhone SDK). That issue is as easy to fix as performing some clicks. Let’s see how:

  1. Open old project. On the upper side of the Xcode window you should see the message of the missing SDK as shown in the image below.
  2. Click the info button (blue icon with the “i”).
  3. Navigate to the “General” tab.
  4. Under the “Base SDK for all configurations” choose the latest version of iOS (now its 4.1. Choose iOS Simulator if you want to run the program on your Mac, or iOS Device if you have a developer device and you want to build the project and run it straight to the device).
  5. Click “build and run” and your project should now compile as usual.
Tags: , , , , , ,

As you may have mentioned, lot of iPhone apps (especially games) run by default in landscape mode! You can easily force the app you develop to run in landscape mode! Let’s see how:

  1. In Xcode find the file [YourAppName]-Info.plist and open it up.
  2. Right click on the table and select “Add Row”. Select “Initial interface orientation” and set the value to Landscape (left or right).
  3. Right click again and add Status bar is initially hidden.This is optional, it has nothing to do with view orientation, but it will hide the status bar.
  4. Open [YourAppName]ViewController.m file and uncomment the following:
    // Override to allow orientations other than the default portrait orientation.
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        // Return YES for supported orientations
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    
  5. Change the code you just uncommented to look like this:
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        // Return YES for supported orientations
        return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
    }

    Parameter interfaceOrientation == UIInterfaceOrientationLandscapeRight starts the app with the Home button at the right side. interfaceOrientation == UIInterfaceOrientationLandscapeLeft starts the app with the Home button at the left side. Set the same landscape orientation that you’ve set in Info.plist file.

Tags: , , , , ,

TopTOP