I am creating an iphone app and wanted to know if using NIB files created and modified using the IB is a better practice or is it ok to write the complete UI code without using a single NIB file?
The reason I ask this is because the data for some of the views is going to be dynamic. that is on my main view depending on the data fetched from my server through XML I might need to show one or two or three or four buttons.( a max of four buttons )
So currently i have written this using code and not using even a single NIB file, is this correct design for dynamic data that might change the number of buttons displayed?
What I’ve found is that NIB files restrict you a hell of a lot.
Its good to see where everything is laid out, but at the end of the day if you CAN learn to programatically create your layout then I would suggest doing that. It helps with so much in your iphone application, and gives you much more control.
I don’t know if there is a best practice, but I would definitely recommend doing everything programatically (unless you don’t want that much control over your view).
That said, if I have a simple view I will do it with NIB files. Something like a splash screen maybe. However I’ve just been working on an app with a modal tab bar controller and a navigation controller and different dynamic views and the buildup of different layers and such is so complicated that doing it in interface builder would be far too difficult if not impossible.
Hope that helps.