How come whenever I have to use awakeFromNib protocol I have to put it in this format?
-(void)awakeFromNib
What is the need for -(void)?
The -(void)
is used in the declaration of the method. Presumably, you are defining it for someone else to call, rather than calling it yourself.
The -
sign indicates that the method is an instance method, as opposed to a class method. It requires an object to call it, and instance variables of the object are available to it inside its definition.
The (void)
indicates the return type. This method doesn't return anything, so its result can't be assigned to anything.
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