views:

42

answers:

1

hi,

is it possible to design a view in interfacebuilder and use it dynamically a few times?

the view structure is

- UIScrollView
  - UIView
    - UIImageView
    - UILabel

now i want to dynamically create multiple instances of the UIView in a for loop with different UILabels and UIImageViews. I want to give them side-by-side in the imageview.

thanks + regards

+1  A: 

Sure. Just call:

[[NSBundle mainBundle] loadNibNamed:@"myNibName" owner:self options:nil];

It returns an array that contains all top-level objects you have placed in the NIB file. You can then assign those objects to any of your instance variables/properties. See the documentation for details.

Ole Begemann
nice. thank you!
Tronic