在iphone设备中看不到飞溅屏幕

在iphone设备中看不到飞溅屏幕,iphone,objective-c,ios,xcode,Iphone,Objective C,Ios,Xcode,我想将闪屏添加到我的应用程序中。我正在写下面的代码。它在ios模拟器中可见,但在设备中不可见。有什么建议吗 UIImageview *splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 460)]; splashView.image = [UIImage imageNamed:@"default1.png"]; [self.window addSubview:splashView]; [self.windo

我想将闪屏添加到我的应用程序中。我正在写下面的代码。它在ios模拟器中可见,但在设备中不可见。有什么建议吗

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];


该问题很可能是由于图像文件名与代码中引用它的名称(
default1.png
)之间的大小写差异造成的。请在项目导航器和代码中检查大小写是否匹配

模拟器通常不区分大小写(因为OSX安装默认不区分大小写),而设备具有区分大小写的文件系统

因此,如果图像文件名为(例如)
Default1.png
,并且您在代码中使用字符串
Default1.png
调用它,它将在模拟器上工作,但在设备上不工作

-(void)finishAnimation
{
    [splashView removeFromSuperview];
    self.window.rootViewController =self.navcontroller;
}