0

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.

Community
  • 1
  • 1
Piyo
  • 181
  • 1
  • 2
  • 9
  • 1
    its different with mine, please. The procedure is same but i have some error. – Piyo Aug 08 '12 at 11:16
  • Is this definitely your actual code, because it _ought_ to be fine. Are you getting any other compiler warnings, or doing any other imports? Is that the full content of your second controller's header file? – jrturton Aug 08 '12 at 11:20
  • I agree, this is not a duplicate of the linked question. The OP is trying to do the right thing, but has an error caused by something else. – jrturton Aug 08 '12 at 11:21
  • i just curious, is that because i using tab bar? i always using this method for passing data but not this time. – Piyo Aug 08 '12 at 11:25
  • 1
    Is it possible you have multiple versions of SecondViewController.h in your project directory/subdirectories? (Have you tried cleaning your build directory?) – Phillip Mills Aug 08 '12 at 11:52
  • thank you Mr Philip, i've multiple version and it fix now! – Piyo Aug 08 '12 at 13:17

1 Answers1

0

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.

Daniel
  • 23,129
  • 12
  • 109
  • 154