Advertise here

Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Parsing JSON into Fundamental STOCK

zachynekzachynek Posts: 39Registered Users @
edited April 2011 in iOS SDK Development
As I have followed this tutorial I made my JSON file look like this:


That means, I have 2 objects (two dictionaries to parse into Cocoa elements). Therefore, I save JSON value into an NSArray and then go through this array and getting value for each those two dictionaries:

[PHP] NSString *responseString = [[NSString alloc] initWithData:dataWebService encoding:NSUTF8StringEncoding];
NSLog(@Response: %@",responseString);

NSArray *arrayOfDictionaries = [responseString JSONValue];
for (int a=0; a<[arrayOfDictionaries count]; a++) {
NSDictionary *dictionary = [arrayOfDictionaries objectAtIndex:a];
NSString *name = (NSString*) [dictionary objectForKey:@name];
NSLog(@%@", name);

However I keep getting this error -JSONValue failed. Error trace is: (
"Error Domain=org.brautaset.JSON.ErrorDomain Code=10 \"Garbage after JSON\" UserInfo=0x4b50d30 {NSLocalizedDescription=Garbage after JSON}"
. Can somebody see what is wrong???
Post edited by zachynek on


Sign In or Register to comment.