最佳答案
I have an array with a bunch of strings and I want to check if a certain string is contained in the array. If I use the containsObject
: message on the array, I'm getting correct results. Do all NSString
objects with the same string point to the same object? Or why is the containsObject
: working?
NSArray *stringArray = [NSArray arrayWithObjects:@"1",@"2",@"3",anotherStringValue, nil];
if([stringArray containsObject:@"2"]){
//DO SOMETHING
}