views:

44

answers:

1

Say I have 2 subclasses from UIViewController, class A and class B. In Main nib file an object is representing class A and it is set to load file from Secondary nib file. The owner of Secondary nib is of class B.

The question is - from which class an object in Main nib file will be instanciated once the nib files unarchived in the memory?

The reason this question arised is that I have to take care myself if such reference to external NIB file present, to ensure that the first nib's object and second nib's owner is same. Please correct me if my statement is wrong.

A: 

Interesting question but one you can answer yourself :)

Set breakpoints in your initWithCoder methods for classes A and B - see which breakpoint gets called!

I have a hunch that Main.xib is going to instantiate an instance of A. Then Secondary.xib will treat your instance of A as an instance of B and it will crash horribly. But I'm not 100% sure ;)

deanWombourne