views:

51

answers:

3

I've been using Xcode for a while and had a brief look at the interface builder when I first started but then went straight on to coding everything.

So far it's working OK but I just wondered if I'm missing something by not using the IB.

Is there any advantage to using the IB at all? I've even coded subviews and stuff without using the IB but I can't help thinking that it might be more advantageous to use it?

If not I'll keep on doing what I'm doing as it's working for me up to now :D

Thanks

A: 

possible duplicate of: http://stackoverflow.com/questions/3438804/iphone-app-best-practice-is-using-the-ib-a-better-way-to-design-your-app-or-wr/3439305#3439305

at the end of the day its whatever you feel more comfortable doing. IB is horrible in my opinion, programming takes more effort - more thought. :)

Thomas Clayson
"more thought" agreed, programming does need more thought, but do you want to spend your time thinking about the problem domain and the implementation of features, or about how many points to the left and what colour your controls are? :P (i'm being facetious, to each their own).
dannywartnaby
sorry my answer doesn't read very well... i was giving two sides of a coin read as "IB is horrible BUT programming takes more effort - therefore its whatever you feel more comfortable doing". :) Thats what I'm saying - you end up spending all your time just trying to get the layout spot on and budging something 1px to the right, building, clicking to that view looking going back budging it 1px again etc etc gets very tiring very quickly.
Thomas Clayson
MY reason for not using IB is that it is annoying when implementing methods and trying to do other things. Mixing IB and programming (espcially anything that uses subviews of the view from IB) gets annoying and tedious. Separating the view from the methods was a good idea on paper - but integrating it just annoys... well, me at least. :)
Thomas Clayson
+1  A: 

If constructing everything in code is working for you, then great. Personally if it can be done in IB it's done in IB.

I'd be surprised if there's a best practice for this; everyone will have their opinion and preference.

I like to do UI related work in IB - if i'm dealing with presentational concerns I like to be in an environment that offers immediate visual feedback. It also cuts down the amount of boiler-plate code that you would have if constructing everything programmatically.

That said you can't do everything in IB. There are times you'll fall back on programatically constructing or laying out a view.

A little knowledge of both approaches goes a long way...

dannywartnaby
A: 

I usually use IB, get immediate visual feedback and make the layout looks exactly easier. Only in one case that I have to give up with IB is performance with UITableView scrolling. In this case, the best solution I can find is to write code to draw everything in the cell using code. This makes the performance much better.

Generally, I recommend to use IB until you have some specific requirements like performance or you need to have really much control over the view

vodkhang