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 6967779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:21:57+00:00 2026-05-27T16:21:57+00:00

If i have two nibs with several views, is there a way for me

  • 0

If i have two nibs with several views, is there a way for me to use the addSubview: method between them? What I would like to do is take a view from one of the nibs and tell it to add a subview that would be a view in the other nib file.

The reason I have them in separate nibs is because the subview from the second nib will be added several times, using the same template but different parameters.

  • 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-05-27T16:21:58+00:00Added an answer on May 27, 2026 at 4:21 pm

    Yes, you can add a view in one nib as a subview to the view in another nib.

    You need to create a NSViewController object which will own the child nib. So that as soon as you initialize the view controller the nib associated with it is loaded. Now you can use the view property of the controller and add it as a subview to any other view.

    The code below will help you understand better:

    YourViewController.m

    -(id)init 
    {    
        self = [super init];
    
         if(nil != self)
         {
             [NSBundle loadNibNamed:@"myNibName" owner:self];
         }
    
         return self; 
    }
    

    YourOtherClass.m

    -(void)addYourViewControllerViewAsSubview
    { 
    
        YourViewController *yvc = [[YourViewController alloc] init];
    
        [yourOtherViewOutlet addSubview:yvc.view];
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this iPad application with different NIBs and views. Each view has two
Is there any way to have two .nib files with the same name? I'm
Have two UIBarButtonItems want to make it as one UIBarButtonItem and toggle between them
Have two tables with a linking table between them. USERS +-------+---------+ | userID| Username|
I have a Nib file with two windows in it. Is there a way
I have two lists, let's say: a = [1,2,3] b = [1,2,3,1,2,3] I would
I have two classes which need to be in same xml file. The way
I have an universal App with two storyboards: iPhone.storyboard iPad.storyboard Now I have views
I have a UIViewController with some controllers and some views. Two of these views
Have two tables named Employee and Order. The relations between the tables Employee (1)

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.