cocoa - Display custom view from Xib -


I'm a newbie In my coke app there are three files:

  • toggle button With main window "MainMenu.xib"

  • "Custom View.xib" A custom view.

  • "Optional.xb" An optional custom view with a different size and number of controls.

My questions are:

  1. How do I display a custom view from "customview.exb" in the main window?

  2. Toggle the "Custom WAVB" and "Optional.exib" when you press the button?

  3. Are the views of the boundaries in the main Exhibit?

thanks

to start a Good place. Basically, you instantiate some owners (who keep outlets / actions) if it does not exist and ask NSBundle to load the tackle with the given owner. If everything goes well then you will have your own UI which is all wired and ready.

How to toggle between them, it is too broad to answer. At your most basic, you can always add custom / optional views as sub-views of different tab view items in a tabless tab view, and if some action is taken then you can ask to select the given tab . To use a little more complex (only a little bit) NSVUVs, they will swap out of something containing supervision.

Regarding your third question ... can you write it again? As you express it, the differences are one) You will have more work to load it with a different nib, and b) you will not be able to reuse it (i.e., many examples of the same subview assembly can be made ), Which may not be important or important to you in this case because it seems that you only have an example of the content of the customview and the alternative.


Comments