Вам нужно будет добавить «Splashscreen» как самый верхний вид вашего окна, «splashcreen» сам по себе не является представлением.Система просто отобразит default.png:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
splashScreen = [[UIImageView alloc] initWithFrame:CGRectMake(0.0f, -20.0f, 320.0f, 480.0f)];
splashScreen.backgroundColor = [UIColor blackColor];
splashScreen.image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Default" ofType:@"png"]];
[self.window addSubview:splashScreen];
[self.window makeKeyAndVisible];
[self performSelector:@selector(applicationDidStart) withObject:nil afterDelay:0.1];
return YES;
}
splashScreen - переменная класса, вы можете добавить индикатор активности в splashView.
Затем в applicationDidStart
запустили методыпоместите код, который займет некоторое время:
- (void) applicationDidStart {
// some thing that takes a while
[splashScreen removeFromSuperView];
[splashScreen release], splashScreen = nil;
}