开发者

How do I look at the text value of a label?

I am really getting frustrated now! I have a new problem now, all I want to do is say if

lblMessage.Text = "30 Seconds" then do some code otherwise do some other code

if (lblMessage.text isEqualToString:@"30 Seconds")
{
    NSString *strPlayerAtTable = [[NSString alloc] initWithFormat:@"%@ at table", ActivePlayer];
    lblMessage.text = strPlayerAtTable;
}
else
if (nStopClockPos == 30)
{
    lblTime.textC开发者_JS百科olor = [UIColor yellowColor];
    lblMessage.text = @"30 Seconds";
}

I get the error Expected ) before isEqualToString

Have I got to put it into a new string variable or something?

Cheers

Paul


Try adding brackets in the if statement to actually call the NSString comparison method:

if ([lblMessage.text isEqualToString:@"30 Seconds"])
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜