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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:58:07+00:00 2026-06-10T03:58:07+00:00

On my storyboard, my project begins with a split view that automatically assigns my

  • 0

On my storyboard, my project begins with a split view that automatically assigns my custom UITableViewController (embedded in a navigation controller) as the detail view controller (done by relationship segue). How do I access the split view controls from my custom UITableViewController so I can change the master view controller views as appropriate?

  • 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-10T03:58:08+00:00Added an answer on June 10, 2026 at 3:58 am

    UIViewController has a property splitViewController that is a reference to the split view controller the viewController is embedded inside. Since your table view controller is embedded inside a navigation controller, which is itself embedded inside a split view controller, you first need to get a reference to the nav controller, and then from that get its reference to the split view.

    So in your custom tableViewController’s code you can do this:

    UISplitViewController *splitVC = [[self navigationController] splitViewController];
    

    The from that you can get a reference to your masterViewController. The splitViewController has a property viewControllers which is an NSArray of two elements. The element at index zero is the master viewController. The element at index 1 is your detail view controller.

    UIViewController *masterVC = [[splitVC viewControllers] objectAtIndex:0];
    

    Note that if your master is a custom viewController subclass (which it probably is) you should cast it as such when you pull it out of the array.

    If you want to relace the master view controller with a new viewController entirely, you can do that by creating a new array with your new master VC and the existing detail view controller and assigning it to your split view controller’s viewControllers property:

    UIViewController *detailVC = [[splitVC viewControllers] objectAtIndex:1];
    NSArray *newViewControllerArray = [NSArray arrayWithObjects:newMasterVC, detailVC, nil];
    splitVC.viewControllers = newViewControllerArray;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i create project with storyboard base uitabbarcontroller, i try to add splash view that
I am using an iOS 5 storyboard-based project. When presenting a modal view controller
I just created a Xcode 4 Single View project (without storyboard), drag and drop
Using storyboard ,I created a project. Inside viewDidLoad ,I did : NSLog(@"%@",self.view.description); I got
Using storyboard, I have a table view controller containing multiple dynamic prototype cells. One
I've got a project setup using a Storyboard that contains a UITabViewController as the
In my Xcode project, I have several view controllers in my storyboard. How can
After creating an Xcode project from the iPad master/detail storyboard template, I cannot seem
This project is in c# under .net 4. I have a custom object that
within my current project file I have a user control that has a storyboard

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.