views:

203

answers:

1

Hi there,

When it comes to compiling my application, I get the error mentioned in the title. How would I go about remedying this error? Basically, I want to get from one table to the other. Hierarchy, navigation.

NextViewController.m

#import "RootViewController.h"
#import "NextViewController.h"


@implementation NextViewController

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
    // Release anything that's not essential, such as cached data
}


- (void)dealloc {
    [super dealloc];
}

- (IBAction) changeTable:(NSString *)str{
    tblCSS.table = str;
}

The last line contains the error.

If you need any more code, just ask. I'll amend this post with it.

Cheers, Jack

NextViewController.h

#import <UIKit/UIKit.h>


@interface NextViewController : UIViewController {
    IBOutlet UITableView *tblCSS;
}

- (IBAction) changeTable:(NSString *)str;
@end
+1  A: 

Presumably your tblCSS variable is an object, and it doesn't have a property called table. You should either create it as a property, or create accessor variables for it.

Edit:

It's not clear what your code is trying to do. tblCSS is a UITableView, which doesn't have a property called table; and if it did, it is unlikely that it would be a NSString (but who knows?).

Also, IBActions typically take sender as an argument, which will usually be a UIControl, not a NSString.

Paul Lynch
Could you expand on that? I'm quite new to Objective-C and I'm not entirely familiar with it's terminology.
Jack Griffiths
It would be simplest if you posted your definition for tblCSS and table.
Paul Lynch
Updated post with .h
Jack Griffiths
Updated answer.
Paul Lynch
Thanks. Could you tell me how I should set a new property called table? Thank you.
Jack Griffiths
You need to figure out what you are trying to do, first.
Paul Lynch
The aim is to change the visible view on the stack to another table, in this case, tblCSS. I think I've done everything else right, it's just this, really.
Jack Griffiths