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

  • Home
  • SEARCH
  • 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 7727781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:32:55+00:00 2026-06-01T05:32:55+00:00

This might look like a silly question to some, but handling the different types

  • 0

This might look like a silly question to some, but handling the different types of controllers in an iPhone application is still a little fuzzy to me. Here’s the setup:

I have a Tab Bar application with four tabs. Each tab passes control to its respective ViewController, where some of those are initialized with a .XIB file and some are done purely programmatically. One of the programmatic ones is DirectionsViewController, which is essentially a UITableViewController. Selecting a cell from its table needs to present (modally) a DetailedDirectionsViewController, which needs to have some sort of back-reference to the presenting view controller. I figured the easiest way to do this is to add a navigation controller to the Directions and DetailedDirections VCs – except I don’t know how to do this without a .XIB file.

Also, the way I hand control over to DetailedDirections is by changing Directions the following way:

- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    DetailedDirectionsViewController *vc = [[DetailedDirectionsViewController alloc] initWithStyle:UITableViewStyleGrouped];
    [self.tabBarController presentModalViewController:vc animated:YES];
}

I seem to recall one of my professors saying that presentModalViewController is kind of an old method and there are better alternatives… I just can’t remember them right now.

  • 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-01T05:32:56+00:00Added an answer on June 1, 2026 at 5:32 am

    For what you want to do it would be best to have the tab in your tabbar manage a UINavigationController, and to set the rootViewController of that navigation controller to your DirectionsViewController.

    Then in your direction view controller’s didSelectRowAtIndexPath: methods you can do the following:

    - (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        DetailedDirectionsViewController *vc = [[DetailedDirectionsViewController alloc] initWithStyle:UITableViewStyleGrouped];
        [self.navigationController pushViewController:vc animated:YES];
    }
    

    And it will function like you want it to. The UINavigation controller will take care of putting a back button on your detailed directions view controller.

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

Sidebar

Related Questions

This might look like a basic question to some of you but I expect
This might look like a beaten question, but could not find an answer at
This might sound like a silly question but how would I make this code
Now this might look like a duplicate thread, but my question is that I
I know it might look like a silly question but here is my case
This might sound like a bit of a silly question but I been looking
This might seem like a stupid question I admit. But I'm in a small
This might sound like a little bit of a crazy question, but how can
:) This might look to be a very long question to you I understand,
This might be on the discussy side, but I would really like to hear

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.