Xcode add mutable dictionary from JSON to mutable array -


i have mutable array stories i'm trying add copy of json response yields o stories , nothing in array. doing wrong? json object formatted , can display each component individually not add array.

nsstring *str=@"http://www.foo.com/some.php"; nsurl *url=[nsurl urlwithstring:str]; nsdata *data=[nsdata datawithcontentsofurl:url]; nserror *error=nil; nsmutabledictionary *response=[nsjsonserialization jsonobjectwithdata:data options:              nsjsonreadingmutablecontainers error:&error];  nslog(@"your json object: %@", response);   nslog(@"location: %@", response[@"location"]); nslog(@"service id: %@", response[@"serviceid"]); nslog(@"problem: %@", response[@"problem"]);  [stories addobject:[response copy] ];  nslog(@"workorders: %d", [stories count]); nslog(@"wo defined: %@",stories); 

there go...try

nsmutablearray *stories = [nsmutablearray array]; 

Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -