2013-02-28 72 views
0

我已經從我的CoreData中獲取了一個對象,並將其存儲在一個數組中,原型單元格im使用的是LeftDetail,我想填充TableView中的單元格,其屬性內容爲我的Title和Attribute鍵作爲留下細節。就像聯繫人應用程序一樣。如何填充TableViewCell LeftDetail?

怎麼辦?

這是我怎麼設置我的單元格的內容:

if (matchingData.count <= 0) 
{ 
    cell.textLabel.text = @"no item found"; 
} 
else { 
    NSString *displayData; 
    for (NSManagedObject *obj in matchingData) { 
     displayData = [obj valueForKey:@"Name"]; 
     cell.detailTextLabel.text = displayData; 
     cell.textLabel.text = @"Name"; 

     } 
    } 

但只會給我左邊的一個細節,一個標題。

回答

0
tableView:cellForRowAtIndexPath:

,你只需要設置:

cell.detailTextLabel.text = yourText;