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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:09:56+00:00 2026-05-16T01:09:56+00:00

I have a view controller, which creates 2 view controllers inside it. Inside each

  • 0

I have a view controller, which creates 2 view controllers inside it. Inside each of these child controllers I wanted to create a property, which would be public, and accessible from the parent controller.

I am using the following method

TableViewController.h

@interface TableViewController : UITableViewController {
    NSInteger projectId;
}

@property NSInteger projectId;

TableViewController.m

@implementation TableViewController

@synthesize projectId;

...

@end

I was then expecting the parent view controller to be able to create the child and access the parentId variable:

ParentViewController.h

#import "TableViewController.h"
@interface ParentViewController : UIViewController {
    TableViewController* tableViewController;
}

@property (nonatomic, retain) TableViewController* tableViewController;

ParentViewController.m

@implementation ParentViewController

- (void)viewDidLoad {
    self.tableViewController = [[TableViewController alloc] initWithNibName:@"TableViewController" bundle:nil];
    self.tableViewController.projectId = 100;
}

However, the property projectId is not found, and returns the error – Request formember ‘projectId’in something not a structure or a union.

If I change the line

self.tableViewController.projectId = 100;

to

[self.tableViewController setProjectId:100];

I get the warning – ‘TableViewController’ may not respond to ‘-setProjectId’

I am compiling this within XCode 4 preview 2, but also have the same issue within XCode 3.2

I am obviously missing something obvious, but cannot work out what it is.

Why can I not access this property?

  • 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-16T01:09:56+00:00Added an answer on May 16, 2026 at 1:09 am

    Turns out that I had 2 copies of the TableViewController files. One had all my changes, the other was empty. I had initially created the file in the wrong directory and when I deleted it I had just removed it from the project.

    Once I deleted these bogus files, everything worked fine.

    Silly me!

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

Sidebar

Related Questions

I have a view controller which contains a scroll view. Inside the scroll view
i have view controller which contains a button which show the image library ,if
I have a table view controller which doesn't let me manually scroll to the
Ok, so here's the situation. I currently have a view controller called MainViewController which
I have a Controller which returns a ViewModel to a View and it works
I have a navigation controller which also has a table view. I want to
Hi guys i have controller which returns a partial view, the controller is called
In my IB I have a navigation controller which has in it a view
I have two view controllers in a tabbar which can both edit data. Therefore,
So, I have a method create inside my controller, but once I create my

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.