여러 조건으로 여러 if 문을 작성하려고합니다. 코드를 실행해도 잘 동작하지만 결코 출력을 변경하지 않습니다. 저는 항상 두 번째 문장> 29를 얻습니다. 여기에 제 코드가 있습니다.텍스트와 정수를 비교하는 다중 if 문
if (label.text <= @"30")
{label.text = @"Text";}
else if (label.text >= @"29")
{label.text = @"Text";}
else if (label.text >= @"19")
{label.text = @"Text";}
else if (label.text >= @"10")
{label.text = @"Text";}
else if (label.text = @"00")
{label.text = @"Text";}
확인 내 코드를 변경하지만 난 여전히 어떤 제안
label.text = temporaryValue;
if ([label.text floatValue] <= 30)
{label.text = @"text1";}
else if ([label.text floatValue] >= 29)
{label.text = @"text2";}
else if ([label.text floatValue] >= 19)
{label.text = @"text3";}
else if ([label.text floatValue] >= 10)
{label.text = @"text4";}
else if ([label.text floatValue] == 0)
{label.text = @"text5";}
를? –