Exception in iOS5 but not in iOS 6


#1

I am on page 109 “Build and run the application. Once the application launches, the map will display a blue annotation…”

I was able to build and run successfully in iOS 6 simulator, but when I tried to run in iOS 5 simulator and my iPhone with iOS 5.1. I got the exception on

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    at line [self.window makeKeyAndVisible];

I change build target to 5.0 and make sure I linked the library of MapKit.

Anyone has any idea?


#2

I found the problem. It’s because I created the project under iOS6 SDK and by default the view has Autolayout checked. Once I disabled Autolayout, it was running fine.