Black screen before my screensaver screen loads iphone

There is a strange problem in my application in which it shows a black screen for a while before it downloads my splash screen. This black screen is not associated with any current operation, since I first download my splash screen and then run the xml parsing task.

I even tried to use [window makeKeyAndVisible] ;, but in vain.

This' my code is:

- (void)applicationDidFinishLaunching:(UIApplication *)application 
{    
    comingFromLogin = NO;
    //Check For Internet
    gotInternet = [self checkInternet]; //Test for Internet, calling the self method
    if ( gotInternet == 0) 
    {
        //I have no internet
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Sorry No Network Available" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
        [alert show];
        [alert release];
        //  internetIcon.hidden = NO;
    }
    else 
    {
        //I do have internet
        [self didLoadSplashScreen];
    }
}

-(void)didLoadSplashScreen
{
    activity_indicator = [[ActivityIndicator alloc]initWithNibName:@"ActivityIndicator" bundle:nil];
    splashScreen = [[splashScreenView alloc]initWithNibName:@"splashScreenView" bundle:nil];

    splashScreen.view.alpha = 1.0;
    splashScreen.view.frame = CGRectMake(0, 20, 320, 480);
    [window addSubview:splashScreen.view];
    [window addSubview:activity_indicator.view];

    [window makeKeyAndVisible];
    [self disappearSplashScreen];
}

Can anyone help?

This black screen stays about 2 seconds. I am running it on iOS4.

Thanx in advance.

+3
source share
1 answer

! applicationDidFinishLaunching , .

, Default.png, .

+7

Source: https://habr.com/ru/post/1765797/


All Articles