J0k3R
J0k3R

Reputation: 303

Load a nib in second View

enter image description hereI have a Problem to load some nibs in a view which is in another view. I want to load this nibs like frames, do you have some interesting tips for me? Thanks for help Simon


//.h: PopOverView *popView;

//.m:

- (void)viewDidLoad

{

[super viewDidLoad];

`popView = [[PopOverView alloc] initWithNibName:@"PopOverView" bundle:nil];`

}

-(IBAction)pressedButton:(id)sender {

[self.view addSubView:popView.view];

}

He Doesnt know PopOverView. I dont want to PopOver I want to load another view into the grey sector. on the left side you have a Control Table and if you click on it you load will a site. like in html a new Frame. Error news: Use of undeclared identifier 'PopOverView'

Upvotes: 2

Views: 167

Answers (2)

J0k3R
J0k3R

Reputation: 303

Okay I am note sure that you understand me. Maybe I have to explain it again or I understand you and so I am very sorry.

I have a View in this view i created a second view a smaller view with on the right side a tableview. Now I will load with one click on a special row, in the smaller view a "nib". On the Photo upside you see my Objects. I linked a UIView with the smaller View and for testing I created a Button to load a test nib, it still works, but he loads the whole site not only the small view(the grey one in the Photo)

Upvotes: 0

Susim Samanta
Susim Samanta

Reputation: 1593

Please follow below codes.PopOverView is the subclass of UIViewController.

PopOverView *popView = [[PopOverView alloc] initWithNibName:@"PopOverView" bundle:nil];
[self.view addSubView:popView.view];

Upvotes: 2

Related Questions