I am making an application which shows a UILocalNotification and when user clicks on the notification, the app will show a new ViewController (designed in Storyboard) which doesn't have any segue from anywhere in my application.
To detect if the user has clicked on the notification I am doing the following in didReceiveLocalNotification
:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController *checkListVC = [storyboard instantiateViewControllerWithIdentifier:@"MyCheckListVC"];
self.window.rootViewController = checkListVC;
So when user clicks on the notification, above code initiatizes my view controller (lets call it CheckListVC) which has the identifier "MyCheckListVC".
This CheckListVC has tableView, whose delegate and dataSource methods get called (numberOfRowsInSection
& cellForRowAtIndexPath
) when the view controller is initialized. But the problem is the simulator shows blank screen when CheckListVC is initialized instead of showing tableView.
I am not able to debug it because I don't even know where the problem is. The view controller gets initialized properly and all the delegate/dataSource methods are getting called properly, but the screen goes blank.
[self.window makeKeyAndVisible]
after you set your rootViewController, this could be the problem. – limon[self.window makeKeyAndVisible]
but it doesn't help either. – nefarianblack