I have a problem in ViewController. And I’m using xcode 4.3.3, trying to implement iPhone 5.1 apps. Every time I write some code about ViewController, it reports the same error: use of undeclared identifier “viewController”. And if I declare it with type of UIViewController, it has runtime error.
Some codes are like this:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
self.window.rootViewController = [[UINavigationController alloc]initWithRootViewController:viewController];
// Override point for customization after application launch.
return YES;
}
It is in AppDelegate.m file.
Is there any difference in using viewController in ios 4 and 5?
You actually don’t need to need to modify the AppDelegate for this.
Leave it blank:
And then in your storyboard file select the View Controller you want to be the first and make sure “Is Initial View Controller” is selected.