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
精彩评论