I am trying to launch an initial login/registration screen before my TabBarController View loads. I have read that putting a ModalViewController in the First View is a good way to go. This works, but I am trying to add navigation controls to the ModalViewController. I am getting the following issues:
1 – ERROR: Property ‘navigationController’ not found on object of type ‘AppDelegate’
2 – WARNING: Initializing ‘AppDelegate *’with an expression of incompatible type ‘id’
here is the code on my 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]; }
Anyone have any ideas? Thanks so much!
There are Two Problems in your code
1) Accessing the OBJECT with class name. It must be appDelegate.nav… (small
afor Solving 1 ERROR)2) Type Casting the assignment (for Solving 2 Warning)
So your Complete working Code must go as