2011-10-03 137 views
0

下面是具有两个属性和两个属性值的AWS SimpleDB Item的数组(项目3)的返回NSLog。我想显示cell.textLabel.text = ItemName和cell.detailTextLabel.text = Value2的UITableView。UITableView中的SimpleDB项目,属性和值的可变数组

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"]; 
+0

我能改善某些方式这个问题?我需要帮助。 – Eric

回答

0

用途:

for (SimpleDBItem *item in selectResponse.items) 

然后item.name运行GetAttributesRequest,像这样:

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