tags:

views:

22

answers:

1

Hello, I am working on iphone aaplication.. As I have seen in iphone app, the controls used in app are statically predefined in interface builder and uiviewcontroller... But I have to deal with situations where I do not know what type of control to create..The controls are known to me at runtime of application.... How do i populate such controls e.g. datepicker, uipicker,textfield, checkboxes, radios etc dynamically

After populating i also need to perform validation on these controls..

BTW,In android, this was very easy using linearlayout and other ui controls.. How can I achieve same in iphone?

Thanks

A: 

It may seem confusing at first especially given the focus that Apple places on using Interface Builder in their documentation but IB is just a convenience tool designed to help lower the amount of tedium involved in laying out interfaces in code. There's nothing that it can do that you can't do directly in code. Just look up the necessary classes in the documentation to find out the details regarding instantiating them (e.g. look up UIButton to find out how to create a button).

Mattia
The Interface Build files (.xib), traditionally called nib files, are simply xml files that are defining the way a view will look at runtime. All the objects are automatically created for you as defined in the xml. But, as Mattia said, there is nothing stopping you creating them programmatically.
Paul Ardeleanu