title: Open specific tab bar when receive push notification
body: <p>How can i open specific tab bar when receive push notification?</p>
  
  <p>i already put <code>[self.tabBarController setSelectedIndex:2];</code>on viewDidAppear and what happen is in data logging, it showing that it passing through tabBar 2  viewController but it not open/showing that page and remain at the firstView controller/ first tabBar.</p>
  
  <p>and then after i terminate the app and open back, automatically/ suddenly it open the tabBar 2 viewController.</p>
  
  <p>can anyone give any idea or sample code to solve this?</p>
  
  <p>this is in my didReceiveRemoteNotification;</p>
  
  <pre><code>- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
  
      NSLog(@"Remote notification received");
  
      if([userInfo valueForKey:@"app"]) {
  
          NSString *action_app = [userInfo valueForKey:@"app"];
          NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
          [defaults setObject:action_app forKey:@"app"];
  
          NewVC *sample=[[NewVC alloc]init];
          [sample viewDidLoad];
  
          //[self.tabBarController setSelectedIndex:2];
  
          [self clearNotifications];
  
      }else{
  
          NSLog(@"---nothing to read---");
      }
  }
  </code></pre>
  
  <p>NewVC are located at tabbar 2.</p>