【问题标题】:Getting JsonData in UITableView在 UITableView 中获取 JsonData
【发布时间】:2014-10-28 09:32:13
【问题描述】:

我有一个这样的 json 数据

LearnerNotes =     (
                (
                        {
                Notes = "Neely down";
                NotesDate = "2014-10-27 13:53:47";
                NotesID = 15;
            },
                        {
                Notes = Imposition;
                NotesDate = "2014-10-27 13:22:28";
                NotesID = 14;
            }
        )
    );
    PeriodDate = "2014-11-04T10";
    PeriodID = 58127;
    PersonID = 12735;
    SubjectName = English;
    TeacherNotes = "My Learning Choices: This note contoins the some text as the learner provide for the teacher when booking it and will always be shown first";
}

现在我只得到 LearnerNotes 之类的……

 NSArray *notesArray=[[[jsondata valueForKey:@"LearnerNotes"] objectAtIndex:0] valueForKey:@"Notes"];

在控制台目标变成这样

notesarray (
        (
        "Neely down",
        Imposition
    )
)

现在我想在 UITableView 中显示它,但它不会出现,只有最后一个值即将到来(拼版)。 我是 iOS 新手,请帮助...。

【问题讨论】:

    标签: ios objective-c json uitableview


    【解决方案1】:

    在获取 JSON 数据并构建带有所有注释的 NSArray 后,将此 NSArray 保存在某个属性中。

    通过实现所有必需的UITableViewDataSource,将此NSArray 用作UITableView 的数据源

    https://developer.apple.com/library/ios/documentation/uikit/reference/UITableViewDataSource_Protocol/index.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-09-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-14
      • 2018-02-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多