【问题标题】:Mutable Array of SimpleDB Items, Attributes and Values in UITableViewUITableView 中 SimpleDB 项、属性和值的可变数组
【发布时间】:2011-10-03 20:18:18
【问题描述】:

下面是 AWS SimpleDB 项的数组 (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"];

【问题讨论】:

  • 我可以通过某种方式改进这个问题吗?我需要帮助。

标签: iphone uitableview nsmutablearray


【解决方案1】:

用途:

for (SimpleDBItem *item in selectResponse.items)

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-09-22
    • 1970-01-01
    • 2014-09-09
    • 1970-01-01
    • 1970-01-01
    • 2017-12-23
    • 2010-12-02
    • 1970-01-01
    相关资源
    最近更新 更多