【发布时间】:2015-07-30 01:22:11
【问题描述】:
我卡住了!我想在 tableView 中显示数据结果。我创建了一个具有相同属性的类。我应该迭代每个键并将其存储在 NSArray 中吗?我现在该怎么办?
NSDictionary *result =[NSJSONSerialization JSONObjectWithData:requestHandler options:NSJSONReadingMutableLeaves error:nil];
.
2015-07-29 17:55:12.669 Test[9051:173867] {
0 = 200;
data = (
{
name = "John";
lasta_name = "Frusciante"
"avatar" = "https://pictures.com/2516137_1185214515_1677640606.png";
"descripcion" = "Guitar player";
},
{
name = "Chad";
lasta_name = "Smith"
"avatar" = "https://pictures.com/2516137_1185214515_1677640606.png";
"descripcion" = "Drummer";
},
{
name = "Flea";
lasta_name = "Balzary"
"avatar" = "https://pictures.com/2516137_1185214515_1677640606.png";
"descripcion" = "Bass player";
},
{
name = "Anthony";
lasta_name = "Kiedis"
"avatar" = "https://pictures.com/2516137_1185214515_1677640606.png";
"descripcion" = "Vocalist";
}
)
}
【问题讨论】:
-
您不会在 TableVIew 中显示 JSON。您将 JSON 提取到 TableViewDataSource 并显示提取的数据。它起源于 JSON(或 Pig Latin)这一事实是无关紧要的。
标签: ios objective-c xcode uitableview