I’m trying to pass a string through two views on an iPhone app. On my second view that I want to recover the string in the .h i have:
#import <UIKit/UIKit.h>
#import "MBProgressHUD.h"
#import "RootViewController.h"
@interface PromotionViewController : UITableViewController {
NSString *currentCat;
}
@property (nonatomic, retain) NSString *currentCat;
@end
And in the .m i have:
@synthesize currentCat;
However, in the first view controller when I try and set that variable I get a not found error:
PromotionViewController *loadXML = [[PromotionViewController alloc] initWithNibName:@"PromotionViewController" bundle:nil];
[self.navigationController pushViewController:loadXML animated:YES];
[PromotionViewController currentCat: @"Test"];
That third line gives me a: Class method +currentCat not found
What am i doing wrong?
Tom,
The issue in your code appears that you are trying to set the string using a static method call to the class. This would work if you implemented a static method named currentCat:
I don’t think this is what your want.
See below on how to correct your issue.