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
2009-10-17 14:51:38
It doesn't return NSNotFound directly. It returns an NSRange. When it doesn't find the string it returns NSNotFound in NSRange.location.
Abizern
2009-10-17 15:48:24
@Abizern - yes, thanks for clarifying that.
Dave DeLong
2009-10-17 15:52:34