I want touch the UIBarButtonItem
in the top right, and push a new viewController. So, the code is:
UIBarButtonItem *addButton = [[UIBarButtonItem a
Since you have added your vc in storyboard, hence initWithNibName
will not work.
Either use segue
or use storyboard's method instantiateViewControllerWithIdentifier to instantiate the view controller
Use this code it works for you
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
yourViewController *vc = [mainStoryboard instantiateViewControllerWithIdentifier:@"chosenCountry"];
[self.navigationController pushViewController:vc animated:YES];
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController *vc = [sb instantiateViewControllerWithIdentifier:@"chosenCountry"];
[self.navigationController pushViewController:vc animated:YES];