Can't pass data
I am not able to pass data between two views that I have. I have the code below.
In my first .h file
@interface themes : UIViewController {
ViewController *viewcontrollerdata;
IBOutlet UILabel *textfield;
}
@property (nonatomic, retain)ViewController *viewcontrollerdata;
@end
In my first .m file
@synthesize viewcontrollerdata;
- (IBAction)menu:(id)sender {
ViewController *second = [[ViewControlleralloc] initWithNibName:nilbundle:nil];
self.viewcontrollerdata = second;
viewcontrollerdata.passedValue = textfield.text;
[selfdismissViewControllerAnimated:YEScompletion:nil];
}
In my second .h file
@interface ViewController : UIViewController {
IBOutlet UILabel *label;
NSString *passedValue;
}
@property (nonatomic, retain)NSString *passedValue;
@end
In my second .m file
@synthesize passedValue;
- (void)viewDidLoad
{
label.text = passedValue;
}
What is happening is that the label where I am supposed to receive my data is invisible. Any help is appreciated.
xcode-OTHER, OS X Mountain Lion (10.8.4)