ios - Get to specific tabView object from App Delegate -


trying launch specific tabview object app delegate when receive notification, app crashes on launch.

here code:

uistoryboard *storyboard = [uistoryboard storyboardwithname:@"main" bundle:nil]; uiviewcontroller *viewcontroller; customtabviewcontroller  * tabbar = [[customtabviewcontroller alloc] init]; nsdictionary *notificationpayload = launchoptions[uiapplicationlaunchoptionsremotenotificationkey];   nsstring *type = [notificationpayload objectforkey:@"type"];  if([type isequaltostring:@"friend"]){      tabbar.selectedviewcontroller = [tabbar.viewcontrollers objectatindex:2];     self.window.rootviewcontroller = tabbar;     [self.window makekeyandvisible];   }  if([type isequaltostring:@"message"]){     tabbar.selectedviewcontroller = [tabbar.viewcontrollers objectatindex:0];     self.window.rootviewcontroller = tabbar;     [self.window makekeyandvisible];  } 

any ideas?


Comments

Popular posts from this blog

Java 8 + Maven Javadoc plugin: Error fetching URL -

c++ - Msgpack packing bools bug -

java - POJO with list of POJO to JSON display size and index -