【发布时间】:2012-04-13 04:13:29
【问题描述】:
我在构建时遇到 2 个错误,它们位于 AppDelegatem 文件中
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
有两个错误的行:
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
错误1:
Receiver type "ViewController" for instance messages is a forward declaration
错误2:
Receiver "ViewController" for class messages is a forward declaration
带有警报的行:
self.window.rootViewController = self.viewController;
提醒:
Incompatible pointer types assigning to 'UIViewController *' from 'ViewController*'
如果需要,您可以找到以下文本文件 视图控制器 视图控制器 AppDelegatem 这里http://ninjabreakbot.com/stack/
项目适用于 iOS5,我对此很陌生。请让我知道这样的问题有什么用处。或者,如果提供的足够多,您的解决方案!
谢谢!
【问题讨论】:
标签: iphone ios5 compiler-errors