Quantcast
Channel: Infragistics Community
Viewing all articles
Browse latest Browse all 2374

iOS Quick Tip: Find a Number from within an NSString

$
0
0
If you have a string representation of a number, NSString has a few helper methods that make it easy to grab a number. But what happens when you have a string made up of letters and numbers, and you just want the number? First lets look at how you get a number from a string that is just made up of digits: @"12" NSString* val = @"12"; NSInteger number = val.integerValue; @"3.14" NSString* val = @"3.14"; CGFloat number = val.floatValue; Now lets see how you can...(read more)

Viewing all articles
Browse latest Browse all 2374

Trending Articles