Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Splash screen animation is not supporting with Xcode 7 GM(iOS9). App crashes with an error

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

like image 979
narendrakumar b Avatar asked Dec 09 '22 01:12

narendrakumar b


2 Answers


    window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

change to


    [window setFrame:[[UIScreen mainScreen] bounds]];

like image 145
user1404596 Avatar answered Dec 26 '22 08:12

user1404596


It sounds like you're trying to do some networking. In iOS 9, by default, all network communication must be secure. If you are trying to do an http: request, it will fail; you must use https: (unless you switch this feature off in your Info.plist).

like image 22
matt Avatar answered Dec 26 '22 08:12

matt