I'm just a newbie of Objective C iPhone programming... I see a lot of codes that contains method named "awakeFromNib".. What does it really mean? how and when and where to call this method? Thanks...
awakeFromNib
is called for objects (views, controllers, etc.) that are being archived in xib/nib files. This basically means that xib/nib was unarchived, all connections (IBActions
/IBOutlets
) for all objects are made and you have a working object graph.
I use it when I have a custom view class that I gave to a certain view in my xib.
You don't call it. After nib file load, every view inside of it, be it button, UIView or something else, calls awakeFromNib
from their respective class automatically. You override this method for setup and layout, as you would do with init
method if you were creating a subview programmatically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With