私はいくつかのウェブサイトから入手したが、UIAlertViewをUIAlertControllerに変更しなければならなかったパックマンゲームでこのコードを使用しようとしていますが、次のコードには修正方法がわからないプログラミングに新しい、これは本当に初心者の質問であるように感じる - 申し訳ありません!!)UIAlertControllerの使い方
最初のエラーは、4行目ではありません:セレクタのは知られていないクラスメソッドalertControllerWithTitle
第二にエラーが最終ラインである:目に見えるインターフェースは、セレクタを宣言していません"show"
ありがとうございます!
- (void)collisionWithExit: (UIAlertController *)alert {
if (CGRectIntersectsRect(self.pacman.frame, self.exit.frame)) {
[self.motionManager stopAccelerometerUpdates];
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Congratulations"
message:@"You've won the game!"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil
preferredStyle:UIAlertControllerStyleAlert];
[alert show];
}
}
は 'AlertView'は、より多くのオプションと' UIAlertController'を使用しなければならないので、代わりにあなたのiOSの9で廃止予定され、このコードの下にチェック。 – vaibhav
[役に立つリンク](https://www.google.co.in/?gws_rd=ssl#q=uialertview+deprecated+ios+9+)、少し検索:) – vaibhav