else
次のコードは機能しますが、ブロック内で非推奨のメソッド呼び出しが警告につながるため、それでもイライラします。
if ([self.navigationController respondsToSelector:@selector(dismissViewControllerAnimated:completion:)])
{
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
}
else
{
//Here,the warning goes!
//dismissModalViewControllerAnimated is deprecated
[self.navigationController dismissModalViewControllerAnimated:YES];
}
無視された警告を非表示にするにはどうすればよいですか、または問題を解決する他の方法はありますか?