pushing view controller inside a tab bar from app delegate, after a notification.

Posted by shani on Stack Overflow See other posts from Stack Overflow or by shani
Published on 2010-06-06T13:29:49Z Indexed on 2010/06/06 13:32 UTC
Read the original article Hit count: 272

Filed under:

hi

i have an app with tab bar and a navigation controller inside every tab. i have set a notification that when it lunches the user can get lunch the app by pressing the action on the alert.

i want to redirect the user to one of the views inside one of the controllers.

i have tried this:

  • (void)application:(UIApplication *)app didReceiveLocalNotification:(UILocalNotification *)notif {

    NSArray *data = [notif.userInfo objectForKey:@"todoDate"]; NSInteger ind = [[data objectAtIndex:2] integerValue];

    QuickViewController *detailViewController ; detailViewController = [[QuickViewController alloc] initWithNibName:@"QuickViewController" bundle:nil];

    detailViewController.title = @"Edit"; detailViewController.personName = [data objectAtIndex:0]; detailViewController.DelitionDate=[data objectAtIndex:1]; detailViewController.personCategory=@"NO Category"; detailViewController.personID = ind r ;

    rootControler.selectedIndex = 1; [rootControler.tabBarController.selectedViewController.navigationController pushViewController:detailViewController animated:YES];

}

but nothing is happening (no crashing) except of the :rootControler.selectedIndex = 1;

when i tried : presentModalViewController

i got the view perfectly but without the navigation controller.

thanks shani

© Stack Overflow or respective owner

Related posts about iphone