CustomTableCellView's implementation of -layoutSubviews needs to call super , NSInternalInconsistencyException

ios, ios6, iphone, uitableview

Solution

layoutSubviews needs to call super

Can be worked around on iOS6 by putting everything in your custom tableview cell in a container view. ie Create a new view to fill the cell then place controls etc inside that. Also make sure you set:

[theContainerView setTranslatesAutoresizingMaskIntoConstraints:NO]; 

for the container and subviews

Problem

On using autoLayout in custom cell for tableView xib, i am getting following error. When running in iOS 6 simulator CustomCells's implementation of -layoutSubviews needs to call super ``` Assertion failure in -[CustomCells layoutSublayersOfLayer:], /SourceCache/UIKit_Sim/UIKit-2372/UIView *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after executing -layoutSubviews. CustomCells's implementation of -layoutSubviews needs to call super.' *** First throw call stack: ``` When running in iOS 5 simulator ``` *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'The NIB data is invalid.' *** First throw call stack: ``` Temp Fix : It is working fine if am disabling the autoLayout in custom cell. But orientation handling is not fine in this case. Please help.

Original source

Related problems