Ich habe ARC aktiviert, In meinem didFinishLaunchingWithOptions
Methode, schrieb ich den folgenden Code:Semantic Ausgabe: Inkompatible Zeiger Warnung
AppDelegate.h:
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) ViewController *viewController;
@end
AppDelegate.m:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
ViewController * vc = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController:vc];
self.viewController = nav;
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
Aber die Aussage: self.viewController = nav;
bekommt eine Kompilierungswarnung, die Warnungsinformation ist:
file://.../AppDelegate.m: warning: Semantic Issue: Incompatible pointer types passing 'UINavigationController *__strong' to parameter of type 'ViewController *'
Wie die Warnung entfernen?
Danke.