ios - Best way to parse comma separated list -


i receiving json packet server communicating with, 1 of requests has item in json array returnes string of comma separated strings.

it looks when nslog json packet array.

(     "\"completed\",\"uncompleted value\",\"damaged value\"",     "",     0 ) 

i can access first item of json array this

nsstring *firstjsonstring = [jsonarray objectatindex:0]; 

i parse best/most efficient way going store values coredata object.

so question how can parse comma separated string?

nsarray *items = [firstjsonstring componentsseparatedbystring:@","];  

or

nsarray *items = [firstjsonstring componentsseparatedbystring:@"\",\""]; 

and delete \" first item , \" in last one


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -