开发者

isEqualToString always return YES

I have this line of code

if ([[dateTextField text] isEqualToString:@"Test"]);
{
}

For some reason it is alway开发者_如何学Gos returning YES even when [textfield text] doesn't equal Test. Any idea why?


remove ; at end of if statement


when you put ; at the end of the line then the xcode will take that as the statement.It is not taking it as condition

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜