Work with timer NSTimer

by alex 27. February 2009 09:22

//setup timer somewhere in the code

[NSTimer scheduledTimerWithTimeInterval:5.0f target:self selector:@selector(onTimerEvent:)userInfo:nil repeats:NO];

 

- (void)onTimerEvent:(id)userInfo{

        //Your code when timer fires

}

Show splash screen during loading

by alex 14. February 2009 13:25

//In AppDelegate.m

- (void)applicationDidFinishLaunching:(UIApplication *)application {

 

m_viewController = [[SplashViewController alloc] initWithNibName:nil bundle:nil];

[window addSubview:m_viewController.view];

[window makeKeyAndVisible];

 

//set delay before showing new screen

[NSTimer scheduledTimerWithTimeInterval:5.0f target:self selector:@selector(onSlashScreenExpired:) userInfo:nil repeats:NO];

}

 

- (void)onSlashScreenExpired:(id)userInfo{

[m_viewController.view removeFromSuperview];

[window addSubview:[navigationController view]];

[window makeKeyAndVisible];

}

 

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen