How to load other window with delay in iphone
[NSThread sleepForTimeInterval:2.0];
for delay. But my MainWindow is not appearing. I have written code inside of the function
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 开发者_开发问答
....
}
Where to write the code to show first screen for 2 second.
Thanks in advance.
You can use NSTimer for swap views like the following: You can setup the Timer on:
-(void) swapViews{
// add the second screen as subview of the app window.
}
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// add the first screen as subview of the app window.
[NSTimer scheduledTimerWithTimeInterval:2.0
target:self
selector:@selector(swapViews:)
userInfo:nil
repeats:NO];
}
Use this method too
[self performSelector:@selector(test) withObject:nil afterDelay:2];
精彩评论