objective c - Trouble with JSON parsing in iPhone App -
I am trying to do this work for a while, but I think that to see me I need to get out of my app, in my app, I'm getting JSON values from a web server, and it is parsing it in my table view.
responseData = [NSData dataWithContentsOfURL: [NSURL URLWithString: @ "http: // MyServer / json"]]; NSString * responseString = [[NSString alloc] initWithData: response data encoding: NSUTF8StringEncoding]; NSDictionary * dict = [responseString JSONValue]; TheData = [Dial objectForKey: @ "Data"];
My only problem now is that 'data' is apparently an NSString, as far as I can see. When I call '[Data Count]' with my Visual Controller, the following error comes from GDB.
- [NSCF string count]: 0x6eb5380 sent to unknown selector for example
<> >{"code ": 100," data ": [{** some object * /}]}
You can check that it has an NSString with:
[thedata isKindOfClass: [NSString class]]
You can also use NSString instead Why are you using NSCFString? NSString does not have the counting method! If you want the length of your string:
[the data length];
Comments
Post a Comment