Hi guys. I've been wondering about this a lot. It seems that the more complex the code sample, the less NIB files are used. Is this perhaps because the samples were made before IB was available for the iPhone SDK? Or does using interface builder become a nuisance when dealing with more complex applications (this is the impression I'm getting right now)?
So far it seems to me that linking and maintaining .xibs when dealing with a lot of views is more difficult than the programmatic approach. Is this true or did I get the wrong impression?
Thanks
I use IB all the time, even for some of the most complex stuff.
However, in examples, a graphical design tool doesn't really expose itself well unless you are making a VIDEO based training material.
You can't see all the linking done (objects and methods). The usage of the inspection tool to get the placement fine tuned and items such as that.
The inline code versions, server that purpose well. It also teaches you what is actually going on in the code and how all the items actually work together.
I personally find, that using multiple NIB files for common classes, offer me an opportunity to rapidly design in some situations. For example in one of my current projects, I have 7 different graphical layouts for the same custom class object.
I build a ViewController, that allows me to pass an object to it, and then the view controller will return me the proper NIB name and initialize the class, and I get the object. And the view is the proper view for the current state of the object.
I now have the ability to add even more views of that data, to the same structure with very little code, and most of the work is done with the movement of the mouse.
So use the examples to understand the nuts and bolts, but don't be afraid to use IB once you know how to use it properly. Is also goes without saying, that using IB exclusively is not always the best solution. There are times, when a simple class without a NIB is the most efficient way to go.