I have a for loop which loops through an array and want to match a search field's text to an object in the array.
I have the following code
for (int i = 0; i < [data2 count]; i++) {
if ([data2 objectAtIndex:i] == searchField.text) {
NSLog(@"MATCH");
break;
}
}
I know in Java it can be done by e.g. if(searchField.text.equalsIgnoreCase(the object to match against))
How is this done in objective C, to match the string without case?
Also, what if I wanted to match part of the string, would that be done in Obj C char by char or is there a built in function for matching parts of Strings?
Thanks