I trie like this,What have you tried? Without knowing what you've tried, we have no way of gauging how much to tell you. We could waste our time explaining too much to you, and your time in making you read it all, or we could not explain it enough and go clear over your head.
Try making that an NSString and parsing it, I think. IDK, I haven't actually worked with JSON ever. (Mostly focus on answering what you've tried. It'll help others who know more to help you.)
NSError *error; NSString *str=@"http://ntp-a1.nict.go.jp/cgi-bin/jsont?1232963971.248"; NSData *data=[str dataUsingEncoding:NSUTF8StringEncoding]; NSDictionary *dic=[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&error]; NSObject *idOBject=[dic objectForKey:@"id"]; NSObject *itObject=[dic objectForKey:@"it"]; NSLog(@"Id: %@",idOBject); NSLog(@"It: %@",itObject);
Ok, thanks, I solved my issue?You convert a string to data, then interpret that data as a JSON, but it's not, it's a string. That's why you're getting null.
Read the tutorial from Ray Wenderlich someone posted above (on mobile so I can't look back at who it was) - it'll cover downloading the data.