I have a string that is being generate from a formula, however I only want to use the string as long as all of its characters are numeric, if not that I want to do something dif
Like this:
- (void)isNumeric:(NSString *)code{ NSScanner *ns = [NSScanner scannerWithString:code]; float the_value; if ( [ns scanFloat:&the_value] ) { NSLog(@"INSIDE IF"); // do something with `the_value` if you like } else { NSLog(@"OUTSIDE IF"); } }