views:

156

answers:

1

So, I am trying to search an nsstring for a term us rangeFromString, but whenever there is not anything matching that result, I get something along the lines of 2748601949 as opposed to 0. I am trying to, for example, locate @"sin(",@"cos(", and @"tan(" in a string like @"1+sin(28)+cos(72)". Thank you

+3  A: 

It's returning NSNotFound, which is defined in NSObjCRuntime.h like this:

enum {NSNotFound = NSIntegerMax};
Dave DeLong
It doesn't return NSNotFound directly. It returns an NSRange. When it doesn't find the string it returns NSNotFound in NSRange.location.
Abizern
@Abizern - yes, thanks for clarifying that.
Dave DeLong