Iphone 如何填充TableViewCell LeftDetail?
我已经从CoreData中获取了一个对象,并将其存储在一个数组中,我使用的原型单元格是leftDetail,我想用属性内容作为标题,属性键作为左侧细节填充TableView中的单元格。就像联系人应用程序一样 怎样才能做到呢 以下是我设置手机内容的方式:Iphone 如何填充TableViewCell LeftDetail?,iphone,ios,xcode,tableview,Iphone,Ios,Xcode,Tableview,我已经从CoreData中获取了一个对象,并将其存储在一个数组中,我使用的原型单元格是leftDetail,我想用属性内容作为标题,属性键作为左侧细节填充TableView中的单元格。就像联系人应用程序一样 怎样才能做到呢 以下是我设置手机内容的方式: if (matchingData.count <= 0) { cell.textLabel.text = @"no item found"; } else { NSString *displayData; for
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";
}
}
if(matchingData.count在tableView:cellforrowatinexpath:
中,您只需设置:
cell.detailTextLabel.text = yourText;