small medium large xlarge

Generic-user-small
10 May 2009, 18:15
Bart (3 posts)

Hello,

I often see two approaches when it comes to iPhone programming: 1) Adding controllers to MainWindow.xib. 2) Creating separate nib/xib files for each controller to control.

My question is whether this is basically the same approach in terms of performance or are there drawbacks for each approach. I usually use appraoch 2 but in Bill Dudney’s screencast series on iPhone developement, he chooses the first approach.

All input is welcome!

Bart

Generic-user-small
11 May 2009, 23:18
Brett (9 posts)

I think it comes down to personal preference.

I like the second option because it keeps everything organised and I find it a lot easier to manage.

Photo_23_pragsmall
27 Jun 2009, 03:13
Louis St-Amour (1 post)

2) Creating separate nib/xib files for each controller to control.

As I understand it, the advantage to using separate xib files is that there’s less overhead compared to one mega-xib file. As the .xib stores objects that are then brought back to life, the fewer objects necessary within an xib file, the faster it will load. Though I’m probably also assuming that besides a controller, you’re also including its view in the MainWindow.xib.

What I’m curious about is if there’s any advantages or disadvantages for doing 3) below instead of 2) above:

3) Writing code to create objects yourself instead of using Interface Builder.

I wonder if there’s an easy way to get your own custom controls in Interface Builder’s library. It would be fun if I could drop three20 components into my view, but until then, programming them seems to save more time than dragging in custom object representations and assigning class names to them.

Sometimes I feel like everything should be as easy as Interface Builder, other times I wish I didn’t have to click and swap so much, and just wrote it all in Xcode.

Thoughts?

You must be logged in to comment