有时,您忘记删除的 didFinishLaunchingWithOptions 中有冲突的代码。确保该函数只有您想要的语句。
例如,下面的代码将背景设置为白色。无论您在情节提要中添加什么内容,您仍然会看到全白。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
将其更改为:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
return YES;
}