FlyCodeRepeat
FlyCodeRepeat

Reputation: 396

UITableViewController freezes when segue to another UITableViewController

I have a TableViewController (VC1) set to push-segue to another TableViewController (VC2). This connection was made in storyboard via ctrl-drag from VC1 to VC2. When the segue is performed, the app freezes and I see the CPU peg to 100% and memory usage start climbing rapidly. I started out with a custom VC2 and saw that viewWillAppear was called and the table delegate methods such as numberOfRowsInSection were being executed properly.

In an attempt to narrow down the problem I can see that even a vanilla UITableViewController (no custom controller class) as VC2 has the same problem. But when I set VC2 as just a vanilla UIViewController (not table), it segues fine.

I have about a dozen other TableView -> TableView segues elsewhere in my app that are set up the same way and no problems with them.

VC1 code:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [self performSegueWithIdentifier:@"myseguename" sender:self];
}

Upvotes: 1

Views: 206

Answers (1)

FlyCodeRepeat
FlyCodeRepeat

Reputation: 396

It turns out my problem was caused by trying to use appearance proxy to set the backgroundView of UITableView. Found in the docs (https://developer.apple.com/library/ios/documentation/uikit/reference/UIAppearance_Protocol/Reference/Reference.html) that UITableView backgroundView is not marked as UI_APPEARANCE_SELECTOR.

Upvotes: 4

Related Questions