Yes a nib will cope with both. and you can use the code to set parts of your nib file.
Example:
you have a label in your .xib file. you want - on a button push - this label to be hidden from view.
So in your code you set an iboutlet for the label:
Code:
@prop..... IBOutlet UILabel *theLabel;
Then in the code for your button push you have this:
Code:
- (IBAction) aButton : (id) sender {
self.theLabel.hidden = YES;
}
The same goes for changing colours and images etc etc, but the syntax is obviously different.
What do you mean by a reusable component? Are you thinking of say a tableview cell? As those also get affected if done in the .xib.
My app uses nib files for almost everything, each view has one, and rarely have i set objects on that view through the code - most is laid out in the .xib and hooked up through the .h. If you have something that you want to affect from the code that is in the xib you just need to hook up and IBOutlet or an IBAction depending on the task (hint the IB in both the previous terms stands for Interface Builder)
As for advantages and disadvantages, that is interesting and VERY subjective. There are people here who really do have a problem with IB and there are some who have a problem with just using the code. there is little one can do that the other cant do, although generally in that thought code can sometimes provide better control - this i think is also subjective as i have used and played about with everything in IB at some point or another and i am yet to come across some functionality that is limited in IB (i exclude games here as that requires graphics and more than a few UI elements).
So to conclude my short advantages vs disadvantages this is what i would say - learn them both. I am starting on IB - it is a much faster learning curve and can allow you to roll out an app a lot faster (from a noobs perspective that is - id still consider myself 60% noob) but for the future and for moving to bigger and better apps i would suggest getting a good grasp on how to do it all via code. that way you can make your own decision on which you prefer, and you can have the best of both worlds!
Hope that clears a little bit up - may even spark a little more debate as those who know more then me come and say how wrong i am for liking IB :P