1
votes

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];
}
1
Try using Instruments to diagnose the problem - Mike Pollard
So I profiled my app using Instruments, but this is my first time using it. What should I be looking for? The only thing that stands out immediately is I see a bunch of interrupt events on the main thread. - 695Multimedia

1 Answers

4
votes

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.