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 :)
精彩评论