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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:47:47+00:00 2026-06-08T06:47:47+00:00

I currently have 2 view controllers: ViewController and DetailViewController . Neither of them are

  • 0

I currently have 2 view controllers: ViewController and DetailViewController. Neither of them are Table View Controllers, they are both just View Controllers. However, I do have a table on ViewController which is otherwise working great. I want to segue/pass a variable to DetailViewController when a cell is selected.

Using the storyboard I set up a modal segue from the cell to DetailViewController with the identifier toDetailView.

I tried to use this method to pass my variable (in this example called play) from VC to DVC (via http://developer.apple.com/library/ios/#samplecode/SimpleDrillDown/Listings/Classes_RootViewController_m.html#//apple_ref/doc/uid/DTS40007416-Classes_RootViewController_m-DontLinkElementID_10):

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {

    if ([[segue identifier] isEqualToString:@"toDetailView"]) {

        NSIndexPath *selectedRowIndex = [self.tableView indexPathForSelectedRow];
        DetailViewController *detailViewController = [segue destinationViewController];
        detailViewController.play = [dataController objectInListAtIndex:selectedRowIndex.row];
    }
}

However I get an error: Property 'tableView' not found on object type 'ViewController *'. I think this is because it’s not a Table View Controller? How can I get around this? Or is there another method I could use to segue and pass the variable using (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath?

  • 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-08T06:47:49+00:00Added an answer on June 8, 2026 at 6:47 am

    On the ViewController, create a new property like that :

    @property (nonatomic, assign) IBOutlet UITableView *tableView;
    

    And synthesize it. Then, in Interface Builder, you should be able to assign the outlet to the tableview you are using. This should do the trick

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

Sidebar

Related Questions

Ok, so here's the situation. I currently have a view controller called MainViewController which
Currently using Xcode 4.2 and I have two view controllers (1 and 2). I
I currently have this statement in my SQL View (SQL Server 2008 R2) which
I currently have NSXMLParser working in my viewcontroller. I would like to create a
We currently have a View that queries active directory info. I was wondering if
I currently have a view with columns along the lines of: ID, Name I
I currently have a product view page that contains an MVCContrib HTML Grid with
I have a navigation controller with a table view. In most tutorials I've read
I have a handful of view controllers that inherit from a subclass of UIViewController,
In the iPhone app I'm currently working on, I'd like two view controllers (I'll

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.