开发者

isEqualToString always return YES

开发者 https://www.devze.com 2023-03-31 17:27 出处:网络
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

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

精彩评论

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

关注公众号