ボタンをクリックして、UIViewController クラス (名前は CartViewController) から Appdelegate (名前は SimpleDemoAppDelegate) に移動しようとしています。
ボタン上の IBAction のメソッドとコードは次のとおりです。
-(IBAction) Go
{
AppDelegate *appDelegate = (AppDelegate *) [UIApplication sharedApplication].delegate;
UIViewController* presentingViewController = appDelegate.viewController;
}
私も試してみました
-(IBAction) Go
{
SimpleDemoAppDelegate *appdelegate=(SimpleDemoAppDelegate *)[UIApplication sharedApplication].delegate;
[self.navigationController presentModalViewController:appdelegate animated:YES];
}
と pushViewController も、しかし、それは警告を示しています。
タイプ「UIViewController *」のパラメーターに「SimpleDemoAppDelegate *」を送信する互換性のないポインタータイプ
この警告が表示される理由を説明してもらえますか?