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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:51:33+00:00 2026-05-16T10:51:33+00:00

I have created a Tab Bar Application, removed the default FirstView and SecondView and

  • 0

I have created a Tab Bar Application, removed the default FirstView and SecondView and added the following two ViewControllers:

  1. JustAnotherView (which is simply a UIViewController with a UIView inside)
  2. MyListOfItems (which is a UIViewController with a TableView inside)

I have a 3rd ViewController called ListOfItemsDetailViewController with a UIView inside that is supposed to be called when the user touches one of the TableView cells.

The application compiles without issue. I can touch both Tab Bar buttons and the correct View appear.

PROBLEM:
When I click a TableView cell, the code to switch to the Detail View is executed (without crashing or error), but the View is NEVER shown.

Here is a screenshot of the application and the debugger with an NSLog that shows it made it past the pushViewController without crashing:

http://clip2net.com/clip/m52549/thumb640/1281588813-9c0ba-161kb.jpg

Here is the code.

MyListOfItemsViewController.h

#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import "ListOfItemsDetailViewController.h";

@interface MyListOfItemsViewController : UIViewController {
    ListOfItemsDetailViewController *listOfItemsDetailViewController;
}

@property (nonatomic, retain) ListOfItemsDetailViewController *listOfItemsDetailViewController;


@end

Here is the MyListOfItemsViewController.m file:

#import "MyListOfItemsViewController.h"
@implementation MyListOfItemsViewController
@synthesize listOfItemsDetailViewController;

#pragma mark -
#pragma mark View lifecycle

- (void)viewDidLoad {
    [super viewDidLoad];

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
    self.title = @"My List Of Items";
    NSLog(@"My List Of Items Did Load");
}

#pragma mark -
#pragma mark Table view data source
// Customize the number of sections in the table view.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}
// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return 5;
}


// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";
    NSString *cellMessage;

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }

    cellMessage = [NSString stringWithFormat:@"indexPath: %d",indexPath.row];       
    cell.textLabel.text = cellMessage;
    return cell;
}

#pragma mark -
#pragma mark Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    ListOfItemsDetailViewController *vcListOfItemsDetail = [[ListOfItemsDetailViewController alloc] 
                                    initWithNibName:@"ListOfItemsDetail" bundle:[NSBundle mainBundle]];
    self.listOfItemsDetailViewController = vcListOfItemsDetail;
    [vcListOfItemsDetail release];
    [self.navigationController pushViewController:self.listOfItemsDetailViewController animated:YES];

    NSLog(@"Did Execute didSelectRowAtIndexPath WITHOUT Crashing or Error.");

}

#pragma mark -
#pragma mark Memory management

- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Relinquish ownership any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
    // Relinquish ownership of anything that can be recreated in viewDidLoad or on demand.
    // For example: self.myOutlet = nil;
    NSLog(@"My List Of Items View Did Unload");
}


- (void)dealloc {
    [super dealloc];
}



@end

Please help. It will be very much appreciated!!!

I have been driving myself crazy trying to get basic navigation down in the iOS platform.

Also, pardon the layperson question, I know that most of you already understand how to do this.

Thanks in advance.
Jaosn

  • 1 1 Answer
  • 1 View
  • 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-16T10:51:33+00:00Added an answer on May 16, 2026 at 10:51 am

    In tableView:didSelectRowAtIndexPath: you are referencing a navigationController by self.navigationController, that likely doesn’t exist. You have to use a UINavigationController as one view controller in you tabView and the rootViewController of that navigationController should be MyListOfItemsViewController.

    Please note that you need a UINavigationController for your detail view to push on and self.navigationController is only a way to retrieve one, that has been created and inserted into the hierarchy before.

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

Sidebar

Related Questions

I am new to this iphone development.I have created a tab bar application which
I have created an tab bar application having 3 tab. When I am launching
I have created an application which needs to have a profile box tab which
I have created tab bar programmatically in the view controller. In my application, Initially
I have created a new project from the template: IPhoneOS>Application>Tab Bar Application. I get
I've created a tab bar application. I have four tabs; on the selected tab,
I have a basic project created in xcode as a Tab Bar Application, What
I have Xcode 4 and I created an application using the Tab Bar template
I have a Tab Bar application for iPad, created using the basic Tab Bar
I have a Tab Bar Controller created in Interface Builder Within the Tab Bar

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.