I've heard its simply a question of preference. But there must be advantages to adding views programmatically. Any experienced Xcoders care to comment?
views:
63answers:
3There is no advantage to doing something in code that you can do in IB. It's just a bad habit that people bring with them from other platforms.
It's important to point out, that for very specific things, it can be very useful to "program a view" if you want specific behavior, etc.
So I wouldn't drop the idea, still I recommend to go with Interface Builder for most of the stuff you're going to develop, it will save you writing lot's of code lines + Time.
It will be a lot easier to do via code when adding a lot of similar UI elements.
A side benefit is I can understand what is really going on. Charles Petzold once said he won't write a C# book if he cannot do all via code. I think some programmers just don't like the automatic
feeling of generated code. It's not saying IB is not good for programmers, it's only not good for understanding the nuts and bolts. That's also one reason why many programmers love Delphi (and the IDE).