I usually set options and attributes from the Interface Builder, instead of doing so in source codes. It is because things are visually set and can reduce the amount of coding. It feels more modular to me.
However, there are several attributes which are not quite clear to understand. One of such thing is “User Defined Runtime Attributes”.
First, what does “User Defined” mean here? Second, what is “Runtime Attributes”?
There is no balloon help for that. So, I looked up the document, and would like to explain here more easily.
For custom classes, you would not spend your time to create IB inspector plugins to set properties/attributes, or their member variables usually. Then in -(id)init or -(void)awakeFromNib messages, you would initialize those.
However, if you want to initialized those when they are loaded from a nib/xib file automatically?
Then you can specify those class attributes, or properties there under “User Defined Runtime Attributes”.
In OOP term, a property of a class is realized as a member variable. In this case, it is different from IBOutlets. It is just member variable.
So, setting those under “User Defined Runtime Attributes” has same effect to setting those in -(void)awakeFromNib, because the the -(void)wakeFromNib is called when the Nib/Xib is loaded.
It is up to us, programmers, whether to do so in -(void)awakeFromNib or there using Interface Builder. Which one do you prefer? It can be different case by case. But in my case, I have used the -(void)awakeFromNib.
Do you use the “User Defined Runtime Attributes” setting often? Then when you think it is better than -(void)awakeFromNib?