If the string is not a valid number, then myNumber will be nil . If it is a valid number, then you now have all of the NSNumber goodness to figure ...
stackoverflow.com