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 , override layoutsublayersoflayer:, 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

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -