我在 ViewController 中遇到问题。我正在使用 xcode 4.3.3,试图实现 iPhone 5.1 应用程序。每次我写一些关于 ViewController 的代码时,它都会报告相同的错误:使用未声明的标识符“viewController”。如果我用类型声明它UIViewController
,它会出现运行时错误。
有些代码是这样的:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
self.window.rootViewController = [[UINavigationController alloc]initWithRootViewController:viewController];
// Override point for customization after application launch.
return YES;
}
它在AppDelegate
.m 文件中。
在 ios 4 和 5 中使用 viewController 有什么区别吗?