我在我的应用程序中使用以下代码来显示一个动画的启动画面。在Xcode-6.4(iOS 8)中,应用程序工作正常,但是在Xcode-7GM版本(iOS9)中,应用程序会崩溃并出现错误。
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];`
当我使用Xcode-7GM时,我收到以下错误信息:
在-[UIApplication _runWithMainScene:transitionContext:completion:](/BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3505.16/UIApplication.m:3294)中的断言失败。
kCFStreamErrorDomainSSL
来看,问题似乎与网络有关。你是否在启动时进行某种类型的网络操作?(不好的想法。)并且你是否记得在 iOS 9 中,默认情况下只能使用https:
? - matt