I've got a UILabel and a UITextField. Each time the user enters text in the field, I need to check weather the textfield text exists in the label's text (basically I'm searching the label's text) . I was using
NSRange range = [sentenceRequestLabel.text rangeOfString:resultString];
if (range.location == NSNotFound) {
NSLog(@"string was found");
} else {
NSLog(@"string was not found");
}
to check (resultString being the textfield.text), but even if the label text in the text field is not even close to the label's text NSLog says "string was found". Any ideas what's wrong?