ios - Convert NSData object to NSArray -


this question has answer here:

i response server in format this:

[_postviolationoperation setcompletionblockwithsuccess:^(afhttprequestoperation *operation, id responseobject) {       if (responseobject != nil && [responseobject iskindofclass:[nsdata class]]) {             //some code convert responseobject nsarray             //responseobject looks this: ["fsdfsf","sdfsfd"]       }   } failure:nil]; 

how can convert nsarray?

nserror *error = nil; nsarray *jsonarray = [nsjsonserialization jsonobjectwithdata: responsedata options: nsjsonreadingmutablecontainers error: &error]; 

Comments

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

formula - R: how to pass in a reference to the variable in glm or lm? -