views:

45

answers:

1

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?

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
I don't see how a JSON parser is relevant for parsing CSV data.
St3fan
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