Adding multiple views (& nibs) to a single view controller

491 views Asked by At

I need to implement several views on a single iPad screen. I am creating several classes and then corresponding xib files. I have one main (root) view controller which will manage all the views for the screen. I am not sure how to achieve this. I am using IB for nib files instead of creating views programmatically.Is this a good approach? How to set views on a particular position? Can any one guide me or any better approach.

1

There are 1 answers

0
glogic On

im not sure how correct this is but i use

UINib *nib = [UINib nibWithNibName:nibName bundle:nil];
NSArray *views = [nib instantiateWithOwner:owner options:nil];
UIView *view = [views objectAtIndex:0];

when i want to get a view from a nib and use it as a uiview and move its frame around etc. hope that helps