Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8180821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:19:13+00:00 2026-06-07T00:19:13+00:00

I have a ViewController that includes its own .nib file, I am wanting to

  • 0

I have a ViewController that includes its own .nib file, I am wanting to load another .nib into this ViewController that will be a menu of sorts… however I am just not sure how to do this and was hoping for some help.

Before I show you the code I will explaine what I have done.

  • I have a UIViewController with a Nib that is my main view.
  • I have created another nib which is going to be a menu that appears as a subview to the main view
  • I have changed this nibs class to the UIViewController of the main view so that it can see all of the same IBActions and outlets.
  • I have then run the code below trying to load the seperate nib as a subview however when I run it the subview of the other nib is not showing up….

        jumpBarPortraitNib = [[UIView alloc] initWithFrame:CGRectMake(0.0, 50.0, 320.0, 367.0)];
    
    
    
        // add jumpbar container to view
        [self.view insertSubview:jumpBarPortraitNib belowSubview:actionTabBar];
    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T00:19:15+00:00Added an answer on June 7, 2026 at 12:19 am

    There’s clearly some confusion here.

    A nib is merely an archive that contains(*) objects, including (usually) one or more view objects (UIView in your case). You don’t “load a nib as a subview.” You instantiate the nib, potentially handing it to a UIViewController to own and manage it, and add a view referenced within the nib to your view hierarchy.

    All you have done with your first line of code is create a generic UIView instance with a given frame size and insert it into whatever [self view] is. There is nothing in what you wrote that actually references a nib, even though you misnamed your view as a nib.

    For what you are doing, I would probably go one of two routes:

    1. Add the view as a separate top-level view in your original nib, and connect it to an IBOutlet. You can then display the menu easily from within the common UIViewController instance you have set as the nib’s File Owner.
    2. Have a separate UIViewController instance that will just manage the menu view, and which you will use to instantiate the nib’s contents using -initWithNibName: as @Aaron mentioned. (Note that you shouldn’t need to set the frame externally; the frame will be archived in the nib as a property of the view.)

    *: Not really, but you can think of it this way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ViewController that has its own NIB. I would like to embed
I have created two viewController classes such that one is superclass of another.i have
I have a viewcontroller that is presented modally. [self presentModalViewController:ViewControllerA animated:YES]; Within this ViewControllerA
I have a viewController that autorotates just fine, The problem is that is I
i have more viewcontroller that start from rootviewcontroller. So for example i start with
I have just noticed that my ViewController does not call init (See below) when
I have a class that is viewcontroller and I'v putted it inside of tabbar.
I have a UITabBarController that adds a viewController, but the positioning is off. There
I know this is extremely silly. I have a view controller that scans a
I'm puzzled... I have this function colorWithHexString... when I include it in the viewcontroller

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.