I have a UITextField that has data in it separated by commas (i.e, 1,2,4) I want to look at this string and extract all the numbers out of it that are separated by the commas and put it in and array. So in this example 1 2 4 would be stored in an array. Can someone help me code something like this?
Share
Sure, no problem.
Now you have an array of
NSStringobjects – something like{ @"1", @"2", @"4" }. You can convert those toNSNumbersor to regular integer types if you like. Here’s a link to theNSStringdocumentation for your reference.