Susan
Susan

Reputation: 91

objective C on how to make connection of two .xib file

I have been wrote for two interface of .xib file. How to make connection between these two files? When I run the file, the first .xib will appear then after i click the button, the second .xib file will appear and on the top of first .xib file. Thus, i want use the second .xib function to make control of the first .xib file. Thus, there is two .xib file at the end. How to do it? Thank you.

Upvotes: 1

Views: 609

Answers (2)

terinjokes
terinjokes

Reputation: 355

The button in your first nib should be making a call to the File Owner (mostly likely a controller or application delegate), which should open the second nib.

For example, in one of my applications, I have this bit of code:

- (IBAction)openPreferencesWindow:(id)sender {
[NSBundle loadNibNamed:@"PreferencePane" owner:self];
}

PreferencePane.xib being the name of my second nib.

Upvotes: 1

Abizern
Abizern

Reputation: 150615

I'm not sure I understand the question exactly, but .xib files shouldn't talk to each other. That's what your controller classes are supposed to do.

Upvotes: 1

Related Questions