How to load a NIB inside of a view in another NIB?

Try this self. Myview addSubview: childViewController. View instead of childViewController.

View = self.myView.

Try this self. Myview addSubview: childViewController. View; instead of childViewController.

View = self.myView.

The alternative is to build the "embedded" view (!) in a Nib, say ChildView. Xib, then instantiate it in the ParentViewController. Xib (change the class in the Identity inspector).

There is no need to programmatically self. View addSubview:embeddedView in the parent view controller's -viewDidLoad method. I wrote up how we embed custom-view Nibs inside other Nibs in a longish blog post.

The crux is overriding -awakeAfterUsingCoder: in the ChildView class, replacing the object loaded from the "parent" Nib with the one loaded from the "child" Nib. Note that our custom controls subclass UIView, not UIViewController (see Apple's docs on Custom view controllers: "You should not use multiple custom view controllers to manage different portions of the same view hierarchy. ").

A nib is loaded at runtime, the interface objects are the objects actually instantiated by the nib-loading code. Most new nib files have at least one interface object by default, typically a window or menu resource, and you add more interface objects to a nib file as part of your interface design. This is the most common type of object in a nib file and is typically why you create nib files in the first place.

Load a nib.

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