Question

I'm getting this in the debug console:

*** Assertion failure in -[UITableView layoutSublayersOfLayer:], /SourceCache/UIKit_Sim/UIKit-2935.137/UIView.m:8794

but no message about what the assertion failure was. Other times when I've gotten assertion failures there's some kind of helpful message following it, like "Terminating app due to uncaught exception..." or something. What's a good way to debug this?

Was it helpful?

Solution

This particular assertion (which you can find by searching for "UIView.m:8794") deals with Auto Layout.

It looks like you have a UITableView that's involved with Auto Layout. The assertion you're seeing is:

*** Assertion failure in -[UITableView layoutSublayersOfLayer:],
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', 
reason: 'Auto Layout still required after executing -layoutSubviews. 
UITableView's implementation of -layoutSubviews needs to call super.'

Perhaps you're trying to use Auto Layout in a UITableViewCell or in the table header or footer views?

OTHER TIPS

I had this error too. The table view and everything works perfectly on iOS 8 but crashes on iOS 7.

Turns out, I am setting up my tableHeaderView using Auto Layout during viewDidLoad.

I fixed this by setting a frame for my tableHeaderView instead of using Auto Layout.

As Dave DeLong said, it might also be that you're setting your table view header or footer using Auto Layout.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top