My program is made up of someone's face that needs to be clicked and then it gives a win condition. Simple as it is my program has a big problem. It says correct and generates a new part. That part is fine and would be great if it stopped there but it sends another correct message.
So, Simply my problem is this the program gives the correct message twice. I put my code in below for one of the parts. All of them are similar just with the if statement being equal to different numbers.
Thank you in advance for any help.
So, Simply my problem is this the program gives the correct message twice. I put my code in below for one of the parts. All of them are similar just with the if statement being equal to different numbers.
Code:
-(IBAction)btnMouth;{
if (myRandomNumber == 3){
UIAlertView *playerWin4 = [[UIAlertView alloc] initWithTitle: @"Correct" message: @"You Selected the Mouth." delegate: nil cancelButtonTitle: @"OK" otherButtonTitles: nil];
[playerWin4 show];
}
myRandomNumber = arc4random() % 4;
if (myRandomNumber == 0){
UIAlertView *playerAtt = [[UIAlertView alloc] initWithTitle: @"Part Generated" message: @"Please Select the Nose." delegate: nil cancelButtonTitle: @"Continue" otherButtonTitles: nil];
[playerAtt show];
}
if (myRandomNumber == 1){
UIAlertView *playerAtt = [[UIAlertView alloc] initWithTitle: @"Part Generated" message: @"Please Select an Eye" delegate: nil cancelButtonTitle: @"Continue" otherButtonTitles: nil];
[playerAtt show];
}
if (myRandomNumber == 2){
UIAlertView *playerAtt = [[UIAlertView alloc] initWithTitle: @"Part Generated" message: @"Please Select an Ear" delegate: nil cancelButtonTitle: @"Continue" otherButtonTitles: nil];
[playerAtt show];
}
if (myRandomNumber == 3){
UIAlertView *playerAtt = [[UIAlertView alloc] initWithTitle: @"Part Generated" message: @"Please Select the Mouth" delegate: nil cancelButtonTitle: @"Continue" otherButtonTitles: nil];
[playerAtt show];
}
}
Thank you in advance for any help.