我在应用程序开始时得到一个不同的图像,比如启动屏幕,然后我得到我在编码中放置的实际图像。我在我的didFinishLaunchingWithOptions:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window.rootViewController = self.tabBarController;
self.tabBarController.delegate=self;
[window addSubview:tabBarController.view];
[self.window makeKeyAndVisible];
LoginViewController *vc = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil];
self.loginNav = [[UINavigationController alloc] initWithRootViewController:vc];
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
if([userDefaults valueForKey:@"UserName"] &&[userDefaults valueForKey:@"Password"])
{
vc.username=[userDefaults valueForKey:@"UserName"];
vc.password=[userDefaults valueForKey:@"Password"];
vc.autoLogin=YES;
[vc loginSelectorMethod];
}
else
{
[self.window addSubview:self.loginNav.view];
[self.window makeKeyAndVisible];
}
splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
splashView.image = [UIImage imageNamed:@"splashscreen.png"];
[window addSubview:splashView];
[window bringSubviewToFront:splashView];
[self performSelector:@selector(removeSplash) withObject:nil afterDelay:3.0];
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
NSLog(@"Registering for remote notifications");
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];
return YES;
}
在启动画面出现之前,“Arrow.png”图像出现然后我的启动画面出现。如果我删除“Arrow.png”,那么代替该图像会出现另一个图像,即“aboutus.png”,它会继续。
我在我的项目中搜索了“Arrow.png”,它在我的整个项目的编码中只出现一次。