开发者

show a progressbar for 3 seconds with the splashscreen

开发者 https://www.devze.com 2023-02-22 17:50 出处:网络
in my appdelegate i have method which shows the Default.png for 3 seconds(splashscreen): - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOpt开发者_如何转开发ions:(NSDictionary

in my appdelegate i have method which shows the Default.png for 3 seconds(splashscreen):

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOpt开发者_如何转开发ions:(NSDictionary *)launchOptions {    
        sleep(3);
    // Override point for customization after application launch.

    // Add the view controller's view to the window and display.
        [window addSubview:viewController.view];
        [window makeKeyAndVisible];
        return YES;
}

i need to show with the splashscreen a progressbar which show the 3 seconds loading, can you help me please, it seems that all work (the progressbar creation and initialisation) should be in this method :)


initialize a nstimer with 1 second interval before the sleep(3) which triggers a selector (a method). this selector should update your progressbar by +1, and when it hits 3, you can disable the nstimer.

here's the class reference for NSTimer, and here's a great guide of how you use it :)

0

精彩评论

暂无评论...
验证码 换一张
取 消