私はプログラミングが初めてです。これの何が問題なのかを見つけるのに苦労しています。メッセージに表示されるテキストをランダム化しようとしているアラート ビューです。
-(void)alert:(id)sender{
int randomNumber;
randomNumber = (randomNumber() %3 + 1);
NSLog(@"%i", randomNumber);
if (randomNumber == 1) {
self.YouWin.text = [NSString stringWithFormat:@"You Win"];
}
else if (randomNumber == 2) {
self.YouWin.text = [NSString stringWithFormat:@"You Lose"];
}
else if (randomNumber == 3) {
self.YouWin.text = [NSString stringWithFormat:@"Tie"];
}
NSLog(@"%@",YouWin);
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Hello" message:[NSString stringWithFormat:@"%@",YouWin] delegate:self cancelButtonTitle:@"Ok" otherButtonTitles: nil];
[alert show];
button.hidden = YES;