ios - When will subviews being added to super view from storyboard? -


i create controller storyboard tableview in it.

after compile , run it, tableview shown, when use self.view.subviews subviews in viewdidload method, can not find tableview.

additionally, try performing method [self.tableview removefromsuperview] in viewdidload, tableview still shown @ last.

it seems when viewdidload performed, tableview has not been added the super view yet. however, in controller created storyboard well, can tableview using self.view.subviews in viewdidload...

i wondering lead , when tableview added.

ignore comment, don't think calling super answer (although still practice).

the documentation not clear thing appear able rely on in viewdidload view has loaded, not of subviews, have discovered may or may not be.

if need access sub views guaranteed present @ viewdidlayoutsubviews described in this answer aware called whenever sub views layed out, multiple times in typical app lifespan (e.g. called when user rotates device).

if need @ sub view loaded, subclass , override own viewdidload method.


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -