Objective c Xcode 7 GM(iOS9)不支持闪屏动画。应用程序因错误而崩溃
在我的应用程序中,我使用下面的代码来显示动画启动屏幕。应用程序在Xcode-6.4(iOS 8)中运行良好,但在Xcode-7GM版本(iOS9)中应用程序因错误而崩溃Objective c Xcode 7 GM(iOS9)不支持闪屏动画。应用程序因错误而崩溃,objective-c,animation,ios9,xcode7,Objective C,Animation,Ios9,Xcode7,在我的应用程序中,我使用下面的代码来显示动画启动屏幕。应用程序在Xcode-6.4(iOS 8)中运行良好,但在Xcode-7GM版本(iOS9)中应用程序因错误而崩溃 window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; imageArray = [[NSMutableArray alloc] initWithCapacity:IMAGE_COUNT]; // Build array
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];`
window=[[UIWindow alloc]initWithFrame:[UIScreen mainScreen]bounds];
imageArray=[[NSMutableArray alloc]initWithCapacity:IMAGE_COUNT];
//构建图像数组,在图像名称中循环
对于(int i=1;i这听起来像是您在尝试联网。在iOS 9中,默认情况下,所有网络通信都必须是安全的。如果您尝试执行http:
请求,它将失败;您必须使用https:
(除非您在Info.plist中关闭此功能).我也遇到了同样的问题,通过删除[WindowMakeKeyandVisible];,解决了这个问题
在didFinishLaunchingWithOptions::
[self.window setRootViewController:navController];对于像jonmo这样的我来说,这个错误是因为在退出didFinishLaunchingWithOptions之前没有定义rootViewController
这样做为我解决了这个问题
在Xcode 7之前,它只是一个警告,现在似乎是一个硬停止
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
窗口=[[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]边界]];
改为
[window setFrame:[[UIScreen mainScreen] bounds]];
[窗口设置框:[[UIScreen mainScreen]边界]];
在我的例子中,此错误消息的解决方案是更新一个包含的CocoaPods依赖项,该依赖项名为(我相信它会为应用程序添加一个额外的UIWindow)。我也遇到了同样的问题,通过替换Appdelegate.m
[window addSubview:viewController.view];
与
这不是全部错误消息。出现了断言失败。断言失败是什么?这是我在日志中看到的全部错误消息:2015-09-14 10:11:59.073 appname[721:11491]NSURLSession/NSURLConnection HTTP load failed(kCFStreamErrorDomainSSL,-9802)2015-09-14 10:11:59.441 appname[721:11367]***在-[UIApplication\u runwith main scene:transitionContext:completion:]、/BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit\u Sim/UIKit-3505.16/UIApplication.m:3294中出现断言失败?它说的是“断言失败”,但没有告诉您断言是什么(没有断言消息)这很奇怪。然而,从kcfstreamerordomainssl
听起来,这个问题似乎与网络有关。您在启动期间是否在进行某种网络连接?(坏主意)。您是否还记得在iOS 9中,默认情况下,您只能执行https:
?我还收到以下错误:-“断言失败”-[UIApplication\u runwithmainsecene:transitionContext:completion:,/BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit\u Sim/UIKit-3505.16/UIApplication.m:3294“如何解决此错误根据我的经验,如果出现这种情况,您实际上会在控制台中收到应用程序传输安全警告。@race\u carr有时:”但我也看到它只是默默地失败了。
[window setRootViewController:viewController];