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 *)
In my case the problem was the following:
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.
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.
I had to assign view controller to a (strong) variable so it stayed in memory.