michal.ciurus
michal.ciurus

Reputation: 3664

How to add the same child View controllers to a parent view controller in iOS?

Let's say I have two UIViews in a parent view (a xib). I want to show in these two views different instances of the same View Controller.

I know how I can do it if I have just one view:

    [self addChildViewController:MyChildController];
    [self.myUIVIew addSubview:myChildView];

But how does it work if I want to have two of these ? (a comparison of views with different data for example).

Thanks!

Upvotes: 0

Views: 96

Answers (1)

ksysu
ksysu

Reputation: 311

It will work. Framework uses instances, not a class. So two instances of the same class are different beings.

Upvotes: 1

Related Questions