我尝试制作一个简单的切换视图功能,但它不起作用,然后我尝试查看是否分配了第二个视图并且它很好。问题是我self.navigationControler
的nil
。我该如何解决?
ViewController2 *hs=[self.storyboard instantiateViewControllerWithIdentifier:@"Highscore"];
if(self.navigationController==nil)
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"YOur Message" message:@"Your description"
delegate:self cancelButtonTitle:@"No" otherButtonTitles:@"Yes", nil];
[alert show];
}
[self.navigationController pushViewController:hs animated:YES];