I have created a view using IB in xib, loaded the view, and when I try to customize the containers (image, label, button e.t.c.) some containers are customized and some not. Like if I am setting the image on a image view it is getting set on the other hand customizing the button/label fails. I am doing all these customization in awakeFromNib
method, this method is kept in view created using xib.
I tried to debug to see what's going on behind the scenes. Whenever an instance of view from xib is created awakeFromNib
is called and rest of the picture is well presented by the screenshot below
As the screen shot shows, my code is halt by the breakpoint in awakeFromNib method and the debugger shows view is created in memory, it's subviews images are also created but label and button are nil, also used lldb to see if the things shown in debugger are correct.
Now I am not able to understand this behavior of creating a view using XIB
having some containers created/ some not in awakeFromNib
method, also the docs says use IBOutlets
inside awakeFromNib
to do any customization as the time awakeFromNib
is called the view is completely created. But I guess it's not so.
Any help in decoding/ reverse engineering the above behavior of the debugging or what goes while creating a view with nib is much appreciated.
Many thanks in advance.