NSRange match = [anObject rangeOfString:@"IMG_0063"]; int length = match.length; if (length > 0) { NSLog(@"Yes"); } else { NSLog(@"NO"); }