I loaded some MySQL data back into the application using the code below, of course, not everything is there, only what is required. I can't seem to appreciate the value of cash, even though JSON from my PHP file has returned successfully. I am using Touch JSON.
Please, help?
NSString *urlString = [NSString stringWithFormat:@"http://REMOVED/REMOVED.php?login_key=%@&username=%@",login_key,username];
NSString *strResponse = [self stringWithUrl:[NSURL URLWithString:urlString]];
NSLog(@"%@", strResponse);
NSData *jsonData = [strResponse dataUsingEncoding:NSUTF8StringEncoding];
NSError *error = nil;
NSDictionary *dictionary = [[CJSONDeserializer deserializer] deserializeAsDictionary:jsonData error:&error];
NSLog(@"Cash: %@", [dictionary objectForKey:@"cash"]);
This returns the log below:
2011-05-29 10:10:35.493 test1[623:207] [[[{"uid":"0","username":"admin","password":"REMOVED","email":"REMOVED","cash":"925071","exp":"117500","level":"1","clan":"YES","clanid":"1"}]]]
2011-05-29 10:10:35.495 test1[623:207] Cash: (null)
source
share