I am trying to navigate from UIViewController class (name is CartViewController)to Appdelegate (name is SimpleDemoAppDelegate) by clicking on Button.
The method and code for IBAction on button is
-(IBAction) Go
{
AppDelegate *appDelegate = (AppDelegate *) [UIApplication sharedApplication].delegate;
UIViewController* presentingViewController = appDelegate.viewController;
}
I have also tried
-(IBAction) Go
{
SimpleDemoAppDelegate *appdelegate=(SimpleDemoAppDelegate *)[UIApplication sharedApplication].delegate;
[self.navigationController presentModalViewController:appdelegate animated:YES];
}
and pushViewController too, But it shows warning.
Incompatible pointer type sending 'SimpleDemoAppDelegate *' to parameter of type 'UIViewController *'
Can someone explain to me why I see this warning?