Split up NSString using a comma

Adam Storr picture Adam Storr · Jun 22, 2011 · Viewed 32.6k times · Source

I have a JSON feed connected to my app. One of the items is lat & long separated by a comma. For example: "32.0235, 1.345".

I'm trying to split this up into two separate values by splitting at the comma.

Any advice? Thanks!!

Answer

Alexander Theißen picture Alexander Theißen · Jun 22, 2011
NSArray *strings = [coords componentsSeparatedByString:@","];