xcodeで三目並べゲームをやっています。これは私のコードです
- (IBAction)c1Button:(id)sender {
if ((status.text = @"X goes now"))
{
c1.text = @"X";
if ([c1.text isEqualToString: @"X"])
{
status.text = @"O goes now";
}
else
{
status.text = @"X goes now";
}
}
else if ((status.text = @"O goes now"))
{
c1.text = @"O";
if ((c1.text = @"O"))
{
status.text = @"X goes now";
}
else
{
status.text = @"O goes now";
}
}
}
最初のセルをクリックすると、Xが表示されます。そして、ステータスラベルがOに変わります。しかし、セルがクリックされても、OではなくXが書き込まれます。何が問題なのですか。