I am trying to use this code in a Pacman game that I got from some website, but I had to change the UIAlertView to UIAlertController, except that in the following code there are two errors that I donβt know how to fix (I really new to programming and feel like this is really a newbie question - sorry !!)
The first error is line 4: Unknown class method to prevent selection of ControllerWithTitle
Second error: Last line: no visible interface declares a "show" selector
Thanks!!!
- (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]; } }
source share