How do I use comma-separated-values received from a URL query in Objective-c? when I query the URL I get csv such as ("OMRUAH=X",20.741,"3/16/2010","1:52pm",20.7226,20.7594). How do I capture and use this for my application?
views:
45answers:
1
A:
You have two options:
Use a CSV parser: http://freshmeat.net/projects/ccsvparse
Or parse the data yourself into an array:
// myString is an NSString object containing your data
NSArray *array = [myString componentsSeparatedByString: @","];
pheelicks
2010-03-17 14:09:43
I don't see how a JSON parser is relevant for parsing CSV data.
St3fan
2010-03-17 14:29:29
I mistook the ( brackets for [. If they were [ then the string would be a valid JavaScript array and thus parsable by a JSON parser
pheelicks
2010-03-17 14:42:41
2010-03-17 14:45:21