objective c - Assertion failure in -[UITableView layoutSublayersOfLayer:] -
i want use uisearchdisplaycontroller
on uiviewcontroller
, includes uitableview
.
use autolayout. when try put searchbar (_searchbar) in tableheaderview with
self.tableview.tableheaderview = _searchbar;
i error 'nsinternalinconsistencyexception
', reason: 'auto layout still required after executing -layoutsubviews. uitableview's implementation of -layoutsubviews needs call super.'
disabling autolayout, error disappears, need autolayout...
the error appears, when use custom cells or standardcells...
the error appears, when tableview has no rows...
as general solution problem, or @ least way of finding cause of it:
- turn on exception breakpoints
- subclass
uitableview
, overridelayoutsublayersoflayer:
, calling super - run app - stop in new method
- in debugger, type
po [self _autolayouttrace]
this show printout of every view in window, views auto layout has not been able come solution highlighted asterisks or ambiguous layout
. these views need investigate constraints for.
Comments
Post a Comment