我正在尝试在加载 TabBarController 视图之前启动初始登录/注册屏幕。我已经读过将 ModalViewController 放在第一个视图中是一个不错的方法。这可行,但我正在尝试将导航控件添加到 ModalViewController。我遇到以下问题:
1 - 错误:在“AppDelegate”类型的对象上找不到属性“navigationController”
2 - 警告:使用不兼容类型“id”的表达式初始化“AppDelegate *”
这是我的 ModalViewController 上的代码:
-(IBAction)signUpButtonTapped {
// i need to get the control for main navigation controller
AppDelegate *appDelegate = [[UIApplication sharedApplication]delegate];
[appDelegate.navigationController popToRootViewControllerAnimated:NO];
// create object from app main view to push it
SignUpViewController *signUpViewController = [[SignUpViewController alloc] initWithNibName:@"SignUpViewController" bundle:nil];
[AppDelegate.navigationController pushViewController:signUpViewController animated:YES]; }
有人有想法么?非常感谢!