I want to add splash screen to my app. I am writing below code.It is visible in ios simulator,but it is not visible in device.Any advice
UIImageview *splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 460)];
splashView.image = [UIImage imageNamed:@"default1.png"];
[self.window addSubview:splashView];
[self.window bringSubviewToFront:splashView];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:5.0];
[UIView setAnimationTransition:UIViewAnimationTransitionNone forView:self.window cache:YES];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(finishAnimation)];
splashView.alpha = 0.0;
[UIView commitAnimations];
…
-(void)finishAnimation
{
[splashView removeFromSuperview];
self.window.rootViewController =self.navcontroller;
}
It is visible directly login page
The problem is most likely caused by case differences between your image filename and the name you use to reference it in your code (
default1.png). Please check that the case match in the project navigator and in your code.The simulator is usually case insensitive (because your OSX install is by default case insensitive), whereas the devices have case sensitive filesystems.
Thus if the image file is named (for instance)
Default1.png, and you call it using the stringdefault1.pngin your code, it will work on the simulator but not on the device.