How can I solve AssertionFail when AutoLayout is enabled?

I get:

Assertion failure in -[Cell layoutSublayersOfLayer:], /SourceCache/UIKit_Sim/UIKit-2372/UIView.m:5776 2013-01-06 14:58:42.951 Likely[4588:c07] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after executing -layoutSubviews. Cell implementation of -layoutSubviews needs to call super.' 

I wrote:

 -(void)layoutSubviews{ [super layoutSubviews]; } 

in the file Cell.m. But does not work. What can I do?

+4
source share
1 answer

You can try adding after calling super.

 [self layoutIfNeeded]; 

which will result in:

 - (void)layoutSubviews { [super layoutSubviews]; [self layoutIfNeeded]; } 
0
source

All Articles