你好,這是我的代碼的一部分下載數據的Json圖片
NSURL *jsonURL = [NSURL URLWithString:@"http://*****.php"];
NSString *donneeJson = [[NSString alloc] initWithContentsOfURL:jsonURL];
self.pseudoOnline = [donneeJson JSONValue];
NSDictionary *json2 = [pseudoOnline valueForKey: @"photo"];
NSLog(@"adresse photo%@",[pseudoOnline valueForKey: @"photo"]);
NSString *url = [[pseudoOnline valueForKey: @"photo"]objectAtIndex:0];
NSLog(@"adresse photo%@",url );
adresse photo(
"http://************/XWsmG18O27.jpg",
"http://************/Wz0ab6oIxU.jpg",
"http://***********/9yKzQrpO59.jpg",
"http://************/l2rbNeIK8a.jpg")
UIImage *image = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:url]]];
我怎麼可以下載所有的照片,因爲只有IAM拍照索引0!
THKS
THKS
「NSArray」不是字典。您不能通過鍵引用元素。你需要使用索引。 –
好吧,我會嘗試th – XcodeMania
看到我的編輯 – XcodeMania