闪屏动画不与X code 7 GM(iOS9)支持。应用程序崩溃与错误 [英] Splash screen animation is not supporting with Xcode 7 GM(iOS9). App crashes with an error
问题描述
在我的应用我使用下面的code,显示动画闪屏。在X code-6.4(iOS版8),但来到X code-7GM版本(iOS9)的应用程序崩溃的应用程序工作正常并出现错误。
窗口= [[一个UIWindow页头] initWithFrame:方法[UIScreen mainScreen]界限]];
imageArray = [[NSMutableArray里的alloc] initWithCapacity:IMAGE_COUNT];
//建立图像阵列,通过图像名称循环
的for(int i = 1; I< = IMAGE_COUNT;我++)
[imageArray ADDOBJECT:[UIImage的imageNamed:
[的NSString stringWithFormat:@形象__%d.pngI]]];
animationImageView = [[UIImageView的页头] initWithFrame:方法self.window.bounds];
animationImageView .animationImages = [NSArray的arrayWithArray:imageArray];
//通过所有的图像一个周期需要3.5秒
animationImageView .animationDuration = 3.5;
//永远重复
animationImageView .animationRepeatCount = 0;
//添加子视图,使窗口可见
[窗口addSubview:animationImageView];
[窗口makeKeyAndVisible]
//开始它的动画
[animationImageView startAnimating]
//等待3.5秒,然后停止动画
[自performSelector:@selector(stopAnimation)withObject:无afterDelay:3.5];`
这是在使用X code-7GM什么我收到错误消息:
断言失败 - [UIApplication的
_runWithMainScene:transitionContext:完成:]
/BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3505.16/UIApplication.m:3294
块引用>解决方案窗口= [[一个UIWindow页头] initWithFrame:方法[UIScreen mainScreen]界限]];更改
[窗口SETFRAME:[UIScreen mainScreen]界限]];In my application i am using the below code to show an animated splash screen. App working fine in Xcode-6.4(iOS 8), but coming to Xcode-7GM version(iOS9) app crashes with an error.
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; imageArray = [[NSMutableArray alloc] initWithCapacity:IMAGE_COUNT]; // Build array of images, cycling through image names for (int i = 1; i <= IMAGE_COUNT; i++) [imageArray addObject:[UIImage imageNamed: [NSString stringWithFormat:@"image__%d.png",i]]]; animationImageView = [[UIImageView alloc] initWithFrame:self.window.bounds]; animationImageView .animationImages=[NSArray arrayWithArray:imageArray]; // One cycle through all the images takes 3.5 seconds animationImageView .animationDuration = 3.5; // Repeat forever animationImageView .animationRepeatCount = 0; // Add subview and make window visible [window addSubview:animationImageView ]; [window makeKeyAndVisible]; // Start it up animations [animationImageView startAnimating]; // Wait 3.5 seconds, then stop animation [self performSelector:@selector(stopAnimation) withObject:nil afterDelay:3.5];`
This is the error message what i am getting while using Xcode-7GM:
Assertion failure in -[UIApplication _runWithMainScene:transitionContext:completion:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3505.16/UIApplication.m:3294
解决方案window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];change to
[window setFrame:[[UIScreen mainScreen] bounds]];
这篇关于闪屏动画不与X code 7 GM(iOS9)支持。应用程序崩溃与错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!