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

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

node.js - How to abort query on demand using Neo4j drivers -