3

I am adding cell like below. Before selecting cell, only textLabel is able to be seen, after selection detailTextLabel getting appear too. Why detailTextLabel not on screen from beginning?

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {

    let cell = tableView.dequeueReusableCellWithIdentifier("ooo", forIndexPath: indexPath) as UITableViewCell
    cell.textLabel!.textColor = UIColor.whiteColor()
    cell.textLabel!.text = "asdf1"
    cell.detailTextLabel!.textColor = UIColor.whiteColor()
    cell.detailTextLabel!.text = "asdf2"

    return cell
}
János
  • 32,867
  • 38
  • 193
  • 353
  • I changed and changed back in StoryBoard the Table View Cell Style from Right Detail to sth else and select Right Detail again, and set color / highlighted color again – János Sep 18 '14 at 08:01
  • 1
    See [Subtitles of UITableViewCell won't update](http://stackoverflow.com/questions/25793074/subtitles-of-uitableviewcell-wont-update). Looks to be an Apple bug. You might be able to avoid it if you leave placeholder text in that label in the storyboard, and never set the value to nil yourself. – Carl Lindberg Sep 18 '14 at 14:09
  • no nil, and no empty space allowed, thanks – János Sep 18 '14 at 16:19

0 Answers0