views:

63

answers:

2

Aside from the WYSIWYG editor, what are the advantages of using XIB/NIB files over defining the layout in code in iPhone/iPad/iOS?

While I don't find XIB files much useful, many iOS developers do, which makes me suspect I might not know their benefits or how to use them properly.

+1  A: 
  1. Easier maintenance. More often than not, clients require last minute changes like changing the logo or changing colors or realigning something or some such. Much easier to change it in a xib file and see/show the results immediately
  2. Decoupling. It forces you to write nicely decoupled code right from the offset, which again means easier maintenance.
Vaayu
+1  A: 

Defining things in Interface Builder makes them much easier to adjust later. Also, doing interface elements in code can lead to a lot of code bloat, for setting things like exact placement, font, color, etc.

The main advantage using code directly gives you is speed. But it's usually better to start in IB and then see what might need speeding up.

Table cells are one of the main areas where you might consider drawing elements in code for speed.

Kendall Helmstetter Gelner