だから私は今Objective-CとXcodeに本当にイライラしています(笑)コードが入力された場合に画像をポップアップさせようとしています.ifステートメントは、基本的にユーザーが正しい文字を推測したかどうかを確認します.私のゲームの単語 (ハングマンを考えてください)。if ステートメントに入ったら、「おめでとう! 50 ポイントを獲得しました!」のような画像をポップアップ表示させたいと考えています。そして、ゲーム内の次の単語に移動します...
コードは次のようになります。
if (isWordCompleted)
{
//do some code that has the pop up image
//other stuff as well
}
私はstackoverflow全体を見てきましたが、探している答えが得られないようです:S
編集:
if(isWordComplete)
{
//create an image reference to have pop up congratulating the user for guessing the right answer
UIImage *congratsImage = [UIImage imageNamed:@"Congrats.png"];
UIImageView *congratsImageView = [[UIImageView alloc] initWithImage:congratsImage];
[congratsImageView setFrame:CGRectMake(0, 0, 250, 158)];
[myDisplay setHidden:YES];
[myDisplay2 setHidden:YES];
[myDisplay3 setHidden:YES];
[myDisplay4 setHidden:YES];
[myDisplay5 setHidden:YES];
[myDisplay6 setHidden:YES];
[myDisplay7 setHidden:YES];
[self checkNumberofWordsUserCompleteInLevel:isWordComplete];
[self moveToNextWord];
}