I have two strings both with value null. But when I am comparing the string I have some problem :
if([textField.text isEqualToString:str])
{
//Some code
}
Both are null but control does not get into if condition.
Please help.
Thanks,
Stone
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
[nil anyMethodName]always returns zero/NO. You need to compare with==to handle the null case (but still compare with some form ofisEqualsto handle the non-null case).