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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:24:30+00:00 2026-05-27T23:24:30+00:00

I have a UISplitViewController with a UITableView on the left and a custom view

  • 0

I have a UISplitViewController with a UITableView on the left and a custom view as the detail view.
When the UISplitViewController is loaded, I would like the first element in the TableView to be selected and viewed in the detail view. Currently I’m trying this in the TableView viewDidLoad:

- (void)viewDidLoad
{
    [super viewDidLoad];

    [self tableView:self.tableView didSelectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
}

This almost works, except that the current row is not highlighted as when it is selected by the user. Is there a better way to do this?

  • 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-27T23:24:31+00:00Added an answer on May 27, 2026 at 11:24 pm

    You shouldn’t call didSelectRowAtIndexPath:. The method you were intending is selectRowAtIndexPath:animated:scrollPosition:

    You can consider using a separate method as the default way to display something in your detail view. For example - (void)displayObject:(NSObject *)objectToDisplay. This can be what you call in your didSelectRowAtIndexPath, but by moving the actual logic outside of that method, you will be able to call in other places, such as viewDidLoad or viewWillAppear. There you can also figure out what object it is you want to display (if you are dealing with an array that will be simple), and display it as such.

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

Sidebar

Related Questions

I have a UISplitViewController setup with a custom view added as a subview of
I have an UISplitViewController base project. I want to have a different detail View
I have a UISplitViewController, and I'd like to change the root view controller (on
So I have an instance of MyViewController in the detail view of a UISplitViewController.
I have a UISplitViewController. When the app launches initially, the detail view is showing
I have a generic UISplitViewController (UITableView in the RootViewController and other stuff in the
In my iPad application, i have used UISplitViewController where master view contains table view
I have created a simple iPad application based on the UISplitViewController template. I'd like
I have a UISplitViewController in a xib file that contains two custom UIViewControllers. I
I have a UISplitViewController in an iPad app. When something is selected from the

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.