我在构建时遇到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;
}
Run Code Online (Sandbox Code Playgroud)
有两个错误的行:
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
Run Code Online (Sandbox Code Playgroud)
ERROR1:
Receiver type "ViewController" for instance messages is a forward declaration
Run Code Online (Sandbox Code Playgroud)
误差2:
Receiver "ViewController" for class messages is a forward declaration
Run Code Online (Sandbox Code Playgroud)
警报线:
self.window.rootViewController = self.viewController;
Run Code Online (Sandbox Code Playgroud)
警报:
Incompatible pointer types assigning to 'UIViewController *' from 'ViewController*'
Run Code Online (Sandbox Code Playgroud)
如果需要,你可以找到ViewControllerm的文本文件ViewControllerh AppDelegatem这里 …