In UITableView, cell.detailTextLabel.text isn't working… why?

前端 未结 9 1035
逝去的感伤
逝去的感伤 2020-12-08 00:34

In tableView:cellForRowAtIndexPath: I have the following:

cell.textLabel.text = @\"label\";
cell.detailTextLabel.text = @\"detail\";
         


        
9条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-08 00:52

    Your initialization needs to be changed to this:

    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle 
    reuseIdentifier:CellIdentifier] autorelease];

    I've emphasized and bolded the part you need to change.

提交回复
热议问题