NSString *responseString = [request responseString];
NSDictionary *dictionary=[responseString JSONValue];
NSArray *dic=[dictionary valueForKey:@"data"];
for (int a=0; a<dic.count; a++) {
NSInteger z=(NSInteger)a;
NSLog(@"%@",[[dic objectAtIndex:a] objectForKey:@"nom"]);
}
これはファイルです
{"data":[ "",{"id":"1","nom":"hello","message":["",{"id":1,"nom":"dad"}]}, {"id":"2","nom":"hi","message":["",{"id":"1","nom":"marie"},{"id":"2","nom":"bob"}]} ] }
jsonファイルをparcourしたいとき、変数「a」がobjectAtIndex
整数であるために問題が発生しましたが、たとえば値5を試してみると、完璧に機能します。
手伝ってくれませんか。