本文介绍了NSDictionary到UITableView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到了JSON请求:

I have a JSON request getting this:

bills =     (
        {
    id = 1;
    name = "Cursus Nibh Venenatis";
    value = "875.24";
},
        {
    id = 2;
    name = "Elit Fusce";
    value = "254.02";
}
);

我正在为它创建一个NSDictionary。

I'm creating a NSDictionary for it.

我正在使用JSONKit,我想知道如何用这个值填充我的UITableView?感谢您的帮助!

I'm using JSONKit and I wanna know how can I populate my UITableView with this values? Thanks for any help!

编辑

NSLog(@"my dictionary = %@", resultsDictionary);
my dictionary = {
bills =     (
            {
        id = 1;
        name = "Cursus Nibh Venenatis";
        value = "875.24";
    },
            {
        id = 2;
        name = "Elit Fusce";
        value = "254.02";
    }
);
}


推荐答案

好像在结果中字典,你有一个数组。数组中的每个对象都是字典。试用以下代码。

It seems like In the result dictionary, you are having an Array. Where each object in your Array is a dictionary. Tryout the following code.

NSArray *billsArray = [resultsDictionary objectForKey:@"bills"];

[[billsArray objectAtIndex:indexPath.row] objectForKey:@name tableView数据源方法中的] tableView:cellForRowAtIndexPath:

这篇关于NSDictionary到UITableView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 02:45