Possible Duplicate:
Passing Data between View Controllers
I sometime using passing data between viewcontroller without problem but this time it wont. Please help
my FirstViewController.m
#import "SecondViewController.h"
- (IBAction)passBtn:(id)sender
{
SecondViewController *second =[[SecondViewController alloc] initWithNibName:nil bundle:nil];
second.stringData = dataString.text;
second.stringNumber = numberString.text;
second.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:second animated:YES];
}
my SecondViewController.h
#import <UIKit/UIKit.h>
@interface SecondViewController : UIViewController
@property(nonatomic, retain) NSString *stringData;
@property(nonatomic, retain) NSString *stringNumber;
@end
and i get this error, point to my FirstViewController.m line second.stringData and second.stringNumber
Property 'stringData' not found on object of type 'SecondViewController *'
Property 'stringNumber' not found on object of type 'SecondViewController *'
i also have using other method but the error is same, always said that not found on object of type. but if i Command+click in my stringData or stringNumber, it really bring me to my SecondViewController.h and point to my stringData or stringNumber. please help.
Please verify that in your second view controller implementation file that you are using @sythesize for your two properties declared in the interface.
That seems to be what is causing the problem.