How to load another xib when pressing a button?

Send NSBundle mainBundle loadNibNamed: @"MyXib" owner: self options: nil from your view controller. When the xib gets loaded the view controller will connect its Interface Builder outlets as specified in the xib. Make sure that in IB you've set the class of File Owner to your view controller's class and connected the outlets you need.

Thanks I am quite new to xcode so I might be doing something wrong. In my button action I have the following code: is this all I need to load the nib? – user421704 Oct 18 '10 at 17:58 NSBundle mainBundle loadNibNamed: @"playGame" owner: self options: nil ; – user421704 Oct 18 '10 at 17:59 Yes, that should do it.

You may also want to check the return value of loadNibNamed... to make sure the the nib has been loaded. Oh, and after the nib loads, you may want to add the views loaded from the nib to the view hierarchy like this: bigView addSubview: loadedView. – Costique Oct 18 '10 at 19:36 Thanks very much that was very useful – user421704 Oct 18 '10 at 23:59.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions