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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:46:50+00:00 2026-06-04T09:46:50+00:00

I have 3 viewcontroller. FirsViewController, SecondViewController and ThirdViewController. The FirstviewController is root viewcontroller and

  • 0

I have 3 viewcontroller. FirsViewController, SecondViewController and ThirdViewController. The FirstviewController is root viewcontroller and it is adding secondviewcontrooler xib as the subview. like..

[firstviewcontrollerObject.view addsubview:secondViewcontrollerObj.view].

In secondViewcontroller I have one button. When button touch action is called, ThirdViewController is loaded. like..

[SecondViewControllerobj.view addsubview:thirdviewcontrollerobj.view];

Now ThirdViewCOntroller is on the screen. This viewcontroller has nothing only a small button. So I am seeing 2 buttons on screen. First button is of SecondviewCOntroller and second button is of ThirdViewCOntroller. But, I am able to give touch action of 3rdviewcontroller only not 2ndviewcontroller button.

How should I design my view to take touch of both button and I don’t want to merge both controller i one.

  • 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-04T09:46:52+00:00Added an answer on June 4, 2026 at 9:46 am

    I think you should implement it without using multiple UIViewControllers.

    View Controllers are useful for pushing and poping from a navigation stack: with only one view displayed at time. I did not try, but I think that’s why you get the bug.

    But you prefered navigationControllers to the benefits of their xib, did’t you?

    If so, there is a way to use xib with views :

    NSArray * arr1 = [[NSBundle mainBundle] loadNibNamed:@"MyView1" owner:nil options:nil];
    NSArray * arr2 = [[NSBundle mainBundle] loadNibNamed:@"MyView2" owner:nil options:nil];
    NSArray * arr3 = [[NSBundle mainBundle] loadNibNamed:@"MyView3" owner:nil options:nil];
    UIView * v1 = [arr1 objectAtIndex:0];
    UIView * v2 = [arr2 objectAtIndex:0];
    UIView * v3 = [arr3 objectAtIndex:0];
    
    // now you have your 3 views, do what you want with them:
    v1.center = CGPointMake(100,100);
    [self.view addSubview:v1];
    v2.center = CGPointMake(100,200);
    [self.view addSubview:v2];
    v3.center = CGPointMake(100,300);
    [self.view addSubview:v3];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example I have a ViewController named firstViewController. Then I would like to call
So i have two view controller in FirstViewController and SecondViewController in FirstViewController NSMutableArray *array;
Hi i have two view controller: FirstViewController and SecondViewController FirstViewController.h #import <UIKit/UIKit.h> @interface FirstViewController:
- i have a FirstViewController and a SecondViewController, each has its xib - in
I have an iPhone app with FirstViewController and SecondViewController with respective views FirstView.xib and
I have a viewcontroller like the following. But the touchsBegan doestnt get detected. Can
I have a ViewController that has its own NIB. I would like to embed
I have a custom viewController called SourceListViewController, and I'm adding it into a UINavigationController,
i have viewcontroller with table view that when i click on a cell i
I have declared this ivar in my ViewController.h #import <UIKit/UIKit.h> @interface FirstViewController : UIViewController

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.