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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:07:10+00:00 2026-05-25T21:07:10+00:00

I am making an app for iPad with different views. Till now I have

  • 0

I am making an app for iPad with different views. Till now I have added 2 views. First view is the home screen which has a single button and some images. Pressing button on first view navigates to the second view. Second view has 6 buttons. Now what I want to do is when I press any button on second view, it navigates to the third view. Each button on second view has to show different data. I don’t want 6 different views, instead I want a single third view but it should show only that particular data respective to the button pressed on second view.
How can it be done?? Please help me with the code..
Any help will be highly appreciated..

  • 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-25T21:07:10+00:00Added an answer on May 25, 2026 at 9:07 pm

    You just need a variable in the third view that you set before showing it. I would set a different tag value for each of my buttons and have them all call a single method. In that method, check the tag value of the sender and setup the third view accordingly. Then show it.

    In the third view’s viewDidLoad method you can handle displaying or setting up the new data you assigned to it.

    For example, if you were setting some custom text in the third view you would have this for your button method in the second view:

    - (IBAction)buttonTap:(id)sender {
       UIButton *tappedButton = (UIButton *)sender;
    
       MyThirdViewController *thirdVC = [[MyThirdViewController alloc] initWithNib:@"MyThirdViewController" bundle:nil];
       switch (tappedButton.tag) {
           case 1:
               thirdVC.customText = @"Something for button 1";
               break;
           case 2:
               thirdVC.customText = @"Something for button 2";
               break;
           case 3:
               thirdVC.customText = @"Something for button 3";
               break;
    
       }
       [self.navigationController pushViewController: thirdVC];
       [thirdVC release];
    
    }
    

    In the third ViewController:

    - (void)viewDidLoad {
        self.myTextView.text = self.customText;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making an Ipad app and im not using the views and view
I am making an iPhone and iPad app, which has a requirement for iAds.
I'm making the app-book for ipad like app-magazine. Now I'm using ScrollView and want
I have an iPad app out on the app store which I'm interested in
I am making an iPad app, it currently has multiple UITableViews named like so:
I'm making an iPad app. In the app I have multiple UITextViews. I've already
In my app for iPad I have to use a Text View. I wrote
I'making website which is for all desktop/iPad/iPhone. In one page I have header and
I'm making an iPad web-app, and the client would like it to have two
I'm having problems making my app iPad compatible. I have an implementation of a

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.