UITableView Custom Cells Disappearing content after Scrolling

前端 未结 10 1148
滥情空心
滥情空心 2020-12-17 00:12

I have seen this being asked here many times but none of the solutions worked for me. Here is my code snippet:

- (UITableViewCell *)tableView:(UITableView *)         


        
10条回答
  •  温柔的废话
    2020-12-17 00:29

    In my case the problem was the following:

    1. I had a special case where view controller's view was not pushed or presented modally but I've added it as a subview (view.addSubview) to another view.

    2. This way the actual view was retained by its superview, but ViewController object (which was DataSource for table view) was not retained and went out of memory.

    3. I had to assign view controller to a (strong) variable so it stayed in memory.

提交回复
热议问题