2011-10-03 16 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"]) 
相關問題