0
私は、JSON Webサービスからこのレスポンスを持っている:反復処理し、オブジェクトの配列を構築するためのマップJSON辞書 - Objective Cの
categoria = (
{
"id_categoria" = 61;
imagen = "http://exular.es/mcommerce/image/data/ipod_classic_4.jpg";
nombre = Gorras;
},
{
"id_categoria" = 59;
imagen = "http://exular.es/mcommerce/image/data/ipod_touch_5.jpg";
nombre = Camisetas;
},
{
"id_categoria" = 60;
imagen = "http://exular.es/mcommerce/image/data/ipod_nano_1.jpg";
nombre = Pantalones;
}
);
}
それは、コードのこの部分で辞書にフィードされます。
NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
//data =nil;
NSLog(@"JSNON %@", responseString);
NSDictionary *results = [responseString JSONValue];
NSLog(@"JSNON %@", results);
私は、辞書内のすべてのカテゴリを反復し、プロパティ「名前」とイメージ」を持つオブジェクトのカテゴリーが含まれていることにNSArrayを作成する必要があります。
感謝
ありがとうございましたビル、とても助かりました。 – roof