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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:13:29+00:00 2026-06-18T09:13:29+00:00

Ok, so I a a Master Detail application, and when a user clicks on

  • 0

Ok, so I a a Master Detail application, and when a user clicks on a cell, it loads loads a webpage in the DetailViewController. The problem is, that on the iPhone version (this is a universal app) I have to click on the cell, then go back to the MasterViewController and then click on the cell again to load webpage. I only have to do this once, I think it is like initiating the webpage or something the first time. On the iPad version though, it loads it one the first time. So what’s up?

Here is the code for my applicationDidFinishLaunching AppDelegate.m file, where I init the DetailViewController

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
    MasterViewController *masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController_iPhone" bundle:nil];
    self.navigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController];
    self.window.rootViewController = self.navigationController;
    masterViewController.detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController_iPhone" bundle:nil];
} else {
    MasterViewController *masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController_iPad" bundle:nil];
    UINavigationController *masterNavigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController];

    DetailViewController *detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController_iPad" bundle:nil];
    UINavigationController *detailNavigationController = [[UINavigationController alloc] initWithRootViewController:detailViewController];

    masterViewController.detailViewController = detailViewController;

    self.splitViewController = [[UISplitViewController alloc] init];
    self.splitViewController.delegate = detailViewController;
    self.splitViewController.viewControllers = @[masterNavigationController, detailNavigationController];

    self.window.rootViewController = self.splitViewController;
}

here is the code for the didSelectCellAtIndexPath

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    NSDictionary *object = _objects[indexPath.row];
    NSURL *ex = [NSURL URLWithString:[object objectForKey:@"url"]];
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
    self.detailViewController.detailItem = object;
        [self.detailViewController loadURL:ex];
        self.detailViewController.detailItem = object;
        [self.detailViewController loadURL:ex];
        [self.navigationController pushViewController:self.detailViewController animated:YES];
    } else {
        self.detailViewController.detailItem = object;
        [self.detailViewController loadURL:ex];
    }
}
  • 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-18T09:13:31+00:00Added an answer on June 18, 2026 at 9:13 am

    On the iPad, you have the 2 controllers in a split view controller, so they are instantiated, and their view’s loaded when the app starts up. On the iPhone, that second controller is instantiated, but it’s view isn’t loaded until you push it — I think that’s the difference. You should try moving the detailController method loadURL: to it’s viewDidAppear method, instead of having it in the master controller’s didSelectRowAtIndexPath method.

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

Sidebar

Related Questions

I user Master-Detail created a project. On the MasterViewController , the table cell i
I have a Master-Detail application for iPad. I am using storyboard. When the user
I have a wpv/mvvm-light/vb.net application with a master/detail view. In this view there is
I have a simple Master-Detail application with a MasterViewController and a DetailViewController. Inside of
I have a Master-Detail application.When the user selects a row in the MasterTable, I
I have a master-detail application that has a tableview in the masterViewController and in
I have just run template from Xcode (Master-Detail Application for iPhone). I only added
I created a new iPhone project on a Master-Detail-Application. As I need a login
I've created a Master-Detail Application with Xcode 4.3. In the Master View I want
I have a master detail Application in xCode. In Master View Controller an Array

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.