Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- applicationDidBecomeActive: Fails to push appropriate view
- - (void)applicationDidBecomeActive:(UIApplication *)application
- {
- // to check the session
- XTabViewController *XTabViewCon = [[XTabViewController alloc] init];
- [XTabViewCon pushViewUponCheckedSession];
- [XTabViewCon release];
- }
- - (void)pushViewUponCheckedSession {
- //THIS IS VERY IMPORTANT. IT CHECKS FOR SESSION
- if ([[[ApplicationContext alloc] dataManager ] checkSession]) {
- [self showSessionAliveView];
- //here I can write something that will push a view that was seen last before leaving app to inactive state. May be NSNotification could help me
- }
- else {
- [self showSessionTimeOutView];
- }
- }
- - (void)showSessionTimeOutView {
- //show activity indi
- waitingIndicator = [[MyWaitingIndicator alloc]init];
- [self.view addSubview:waitingIndicator];
- [waitingIndicator setHidden:YES];
- [waitingIndicator stopAnimating];
- //push session timeout view
- SessionTimeOutViewController *sessionTimeOutView = [[SessionTimeOutViewController alloc] init];
- [[self navigationController] pushViewController:sessionTimeOutView animated:NO];
- [sessionTimeOutView release];
- [waitingIndicator release];
- }
- - (void)showSessionAliveView {
- SessionAliveView *sessionAliveViewList = [[SessionAliveView alloc] init];
- [[self navigationController] pushViewController:sessionAliveViewList animated:YES];
- [sessionAliveViewList release];
- }
- - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
- //if X Tab is selected then & only then call this method
- if (tabBarController.selectedIndex == 2) {
- [XTabViewCon pushViewUponCheckedSession];
- }
- }
Add Comment
Please, Sign In to add comment