storyboard的小知识

View Coontroller在不关联的情况下跳转
//写在button的方法中
// 获得storyBoard当前故事板
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
// 初始化要跳转的页面
ViewController2 *advertise = [storyboard instantiateViewControllerWithIdentifier:@"ViewController2"];
[self.navigationController pushViewController:advertise animated:YES];
浙公网安备 33010602011771号