NSString *s1= [btnStreetType titleForState:UIControlStateNormal];
BOOL str= [s1 isEqualToString:s1 ];
In the code above, why does isEqualToString return NO? I have to check whether the title is an empty string or not, but it always returns NO.
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.
I guess s1 or btnStreetType is nil. Otherwhise, there is no reason that test to return NO. Even on empty strings (@””), it should return YES.
Check
btnStreetTypefirst, I think the problems comes from it, it may be nil, becausetitleForStatehas no reason to return a nil value if called on a valid object.