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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:09:17+00:00 2026-06-01T16:09:17+00:00

I have an Xcode Universal Storyboard project that is properly displaying data for the

  • 0

I have an Xcode Universal Storyboard project that is properly displaying data for the iPhone but does not display data for the iPad. I had initialized the data array using the code below.

It is working properly in the iPhone but does not display data in the iPad and gets the error:

-[DetailViewController setDataController:]: unrecognized selector sent to instance

This is the AppDelegate.m

    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
     UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
     UINavigationController *navigationController = [splitViewController.viewControllers lastObject];


     MasterViewController *masterViewController = (MasterViewController *)[navigationController topViewController];
      DataController *controller = [[DataController alloc] init];
      masterViewController.dataController = controller;



 splitViewController.delegate = (id)navigationController.topViewController;
 } else {
      // Create the data controller and pass it to the master view controller.
      UINavigationController *navigationController = (UINavigationController  *)self.window.rootViewController;
      MasterViewController *masterViewController = (MasterViewController *)            [navigationController topViewController];
      DataController *controller = [[DataController alloc] init];
      masterViewController.dataController = controller;
 }

The compiler is complaining about the DetailViewController here is that file.

 #import "DetailViewController.h"
 #import "Play.h"

@interface DetailViewController ()
@property (strong, nonatomic) UIPopoverController *masterPopoverController;
@end

@implementation DetailViewController
@synthesize masterPopoverController = _masterPopoverController;
@synthesize play;

#pragma mark -
#pragma mark View lifecycle


  - (void)viewWillAppear:(BOOL)animated
 {
  [super viewWillAppear:animated];
// Scroll the table view to the top before it appears
  [self.tableView reloadData];
  [self.tableView setContentOffset:CGPointZero animated:YES];
//self.part = play.part;

  }

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
} else {
    return YES;
}
}

#pragma mark - Split view

- (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UITableViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController
{
barButtonItem.title = NSLocalizedString(@"Trading Rules That Work", @"Trading Rules That Work");
[self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES];
self.masterPopoverController = popoverController;
}

- (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UITableViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem
 {
 // Called when the view is shown again in the split view, invalidating the button and popover controller.
 [self.navigationItem setLeftBarButtonItem:nil animated:YES];
 self.masterPopoverController = nil;
 }


 #pragma mark -
 #pragma mark Table view data source

 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// There are 2 sections, for rule, and media, in that order.
return 2;
 }

 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

//The number of rows varies by section.

NSInteger rows = 0;
switch (section) {
    case 0:
        // For part and date there is just one row.
        rows = 1;
        break;
    case 1:
        // For the media section, there are as many rows as there are media.
        rows = [play.media count];
        break;
    default:
        break;
 }
 return rows;
 }

 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *CellIdentifier = @"CellIdentifier";


UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    cell.autoresizingMask = UIViewAutoresizingFlexibleHeight;
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    cell.textLabel.font = [UIFont boldSystemFontOfSize:11];
    cell.textLabel.numberOfLines = 13;

}


NSString *cellText = nil;

switch (indexPath.section) {
    case 0:
        cellText = play.part;
        break;
    case 1:
        cellText = [play.media objectAtIndex:indexPath.row];
        break;
    default:
        break;
}

cell.textLabel.text = cellText;
return cell;
}

 #pragma mark -
 #pragma mark Section header titles

 /*
  HIG note: In this case, since the content of each section is obvious, there's probably       no need to provide a title, but the code is useful for illustration.
  */
 - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {

NSString *title = nil;
switch (section) {
    case 0:
        title = NSLocalizedString(@"Video Description", @"Part section title");
        break;
    case 1:
        title = NSLocalizedString(@"Media", @"Main Media section title");
        break;
    default:
        break;
}
return title;
}

 @end
  • 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-01T16:09:19+00:00Added an answer on June 1, 2026 at 4:09 pm

    When you do

    object.property = value;
    

    in Objective-C code, that’s a short cut for:

    [object setProperty:value];
    

    Since you don’t appear to have a dataController property, there’s no setDataController selector.

    So either:

    • declare a dataController property in your DetailViewController’s .h then synthesize it in your implementation, or
    • create a setter and manually assign it to an instance variable.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two cocoa-touch apps in one Xcode project. Xcode gives me iPhone/iPad related
I have written a universal iOS-App that runs fine on my iPhone and iPad,
I have an iPhone SDK project that is supposed to build a static library
I have an existing iPhone project that has been tested, submitted, and approved, compiled
I'm working on an existing Xcode 3.2.2 Universal iPhone OS project which is already
I currently have an iphone app that I want to make an ipad version
I have build cocoa application in 10.4.4 using (mac10.3.9sdk xcode version:2.2.1,universal binary), but when
I have a Universal app (iPhone/iPad) which is very basic. There is a List
I have a universal app for ipad and iphone. What I'm trying to determine
I have a new project which is an iPhone application. for that I have

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.