UITableView中的SimpleDB项,属性和值的可变数组

时间:2011-10-03 20:18:18

标签: iphone uitableview nsmutablearray

下面是AWS SimpleDB Item的数组(items3)返回的NSLog,它包含两个属性和两个属性值。我想显示cell.textLabel.text = ItemName和cell.detailTextLabel.text = Value2的UITableView。

items3 = (
    "ItemName",
        (
        "{Name: Attribute1,AlternateNameEncoding: (null),Value: Value1,AlternateValueEncoding: (null),<SimpleDBAttribute: 0x2eeaf0>}",
        "{Name: Attribute2,AlternateNameEncoding: (null),Value: Value2,AlternateValueEncoding: (null),<SimpleDBAttribute: 0x2f38e0>}",
    )

如何显示所有项目,但只显示Attribute2的值?有没有办法说Key @“Attribute2”的对象等于value2?

类似的东西:

cell.textLabel.text = [itmes3 objectAtIndex: indexpath.row];
[[ cell.detailTextLabel.text = [[items3 objectAtIndex:0] stringForKey:@"Attribute2"];

1 个答案:

答案 0 :(得分:0)

使用:

for (SimpleDBItem *item in selectResponse.items)

然后在item.name上运行GetAttributesRequest,如下所示:

for (SimpleDBAttribute *attr in response.attributes) {
    if ([attr.name isEqualToString:@"Attribute2"])