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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:54:39+00:00 2026-05-27T11:54:39+00:00

I have following problem. I have created a tab based Application with three Views

  • 0

I have following problem.

I have created a tab based Application with three Views and Viewcontroller.
FirstView(Start screen stuff), SecondView (Detailpage), ThirdView (Table for listing items).
(Connections from storyboard were set automatically).

In the third view a table is integrated and the content is displayed fine.

Now I would like to call the SecondView , when a row in the table is selected.

I also tried to add a forth View , outside the tabBar Controller, to get the Detailview, but this also did not help.

I have tried several tutorials and forum tips, but cannot get it working.

The class is set to the right ViewController, the identifier is set to detail.

-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
DetailViewController *detail = [self.storyboard instantiateViewControllerWithIdentifier:@"detail"];
[self.navigationController pushViewController:detail animated:YES];
detail.label1.text = @"It is working";

}

When clicking on the row, it becomes blue, but nothing happens. No error Message , nothing.

Hope that you can help 🙂


OK, I have tried to “optimize” my design.

Still have the tab based Views, but when clicking on a row in the table, a new (not linked in Storyboard) view should appear to display the details of the selected quote.

  1. I have created a view in the storyboard and called it “detailzitat”
  2. I have created a DetailViewController.h/m as UIViewcontroller class
  3. I have set the custom class to DetailViewController
  4. I import the DetailViewController.h in the ThirdViewController.h

I have modified the didSelectRowAtIndexPath method in ThirdViewController.h accordingly.

 -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
DetailViewController *detailVC = [self.storyboard instantiateViewControllerWithIdentifier:@"detailzitat"];

[self.navigationController pushViewController:detailVC animated:YES];

}

and my DetailViewController.m looks like

#import "DetailViewController.h"
@implementation DetailViewController
@synthesize label1, labeltext;

- (void)viewDidLoad
{
[super viewDidLoad];
labeltext=@"JUHU";
label1.text=labeltext;
}

But again, nothing happens, besides the row gets blue.

I do not understand. If I am using this code in a Non-Storyboard project, it is working.
What am I doing wrong ? Is there any tutorial for this combination within Storyboards ? Have not found one for this approach yet.
Try to learn from the different tutorials on the web, but the biggest problem is, most ones are not for iOS5 and I am not so good to transfer then.

Hope to get some hints 🙂

  • 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-27T11:54:40+00:00Added an answer on May 27, 2026 at 11:54 am

    You might want to think about your design. If I am understanding your description correctly, the user will be on the third tab, tap on a row in a table, and then you will be switching them back to the second tab. A navigation controller might be a more natural, less confusing, choice there.

    But in any case, something like this will work sometimes:

    -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
        DetailViewController *detailVC = [self.tabBarController.viewControllers objectAtIndex:1];
    
        detailVC.label1.text = @"It is working"; // <- this will not work consistently!
    
        self.tabBarController.selectedViewController = detailVC; 
    
    }
    

    The problem with this is that while the user is on that third tab, it’s possible that the second tab view controller’s view is unloaded (due to memory pressure for example).

    It’s also possible the user went from tab 1 to tab 3 immediately and therefore the 2nd tab’s view isn’t even loaded yet at all. (To even test the above code you would have to select tab 2 and then tab 3.)

    If the second tab’s view hierarchy is not loaded, the label1 property will be nil, and so this will not work. A better strategy would be to create a new @property of type NSString* on the DetailViewController. And set that property instead of trying to set the label1 directly.

    Then in your viewWillAppear: for the DetailViewController you can update your labels as needed. At that point of course you can be sure that label1 is loaded and connected to the correct UILabel.

    I hope that helps.

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

Sidebar

Related Questions

I have created a Tab Bar Application, removed the default FirstView and SecondView and
I have following problem: I have built a tabbar application with 4 tabs. I
I have created the following example to illustrate a problem I have with a
I have the following problem: Multithreaded WPF application, Model View Presenter Implementation. Presenters and
I have the following problem: i have some data loaded in my application, that
I have following problem, Code: String a=Yeahh, I have no a idea what's happening
I have the following problem: I have an HTML textbox ( <input type=text> )
I have the following problem using subversion: I'm currently working on the trunk of
I have the following problem using template instantiation [*]. file foo.h class Foo {
I have the following problem in my Data Structures and Problem Solving using Java

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.