Storyboard static cells: dequeueReusableCellWithIdentifier returns nil

前端 未结 5 843
小鲜肉
小鲜肉 2020-11-30 03:55

Using storyboard, static cells, in cellForRowAtIndexPath: the line

UITableViewCell *cell = 
   [tableView dequeueReusableCellWithIdentifier:Cell         


        
5条回答
  •  不知归路
    2020-11-30 04:34

    The solution was to use prototype cells rather than static cells. I am still giving the check to @jrturton as he was the first who got me the idea.

    Another interesting error I just solved: with prototype cells of type "Custom", if you try to fill cell.textLabel with text, it will just automatically work, but all your other subviews behave very strangely. I just use my custom label now, and everything works fine.

    Cheers, thanks everyone for helping out.

提交回复
热议问题