Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

forrestgrant

macrumors member
Original poster
Jun 24, 2008
34
0
I am using NSComparisonResult like so:
Code:
NSString *haystackText = @"Hello World";

NSComparisonResult result = [haystackText compare:searchText options:NSCaseInsensitiveSearch range:NSMakeRange(0, [searchText length])];

So if searchText = @"he" then the result is true.
But if searchText = @"World", it does not return.

Is there an option to pass NSComparisonResult to get it to find within the string instead of just an exact match of the beginning?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.