Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Carrying the contents of a label from one view controller to another
- @interface ViewControllerOne : UIViewController {
- IBOutlet UILabel *myLabelOne;
- }
- @property (nonatomic, retain) IBOutlet UILabel *myLabelOne;
- @end
- @interface ViewControllerTwo : UIViewController {
- IBOutlet UILabel *myLabelTwo;
- }
- // myLabelTwo doesnt need to be a property, it could just be an ivar. Up to you.
- @property (nonatomic, retain) IBOutlet UILabel *myLabelTwo;
- @end
- @implementation ViewControllerTwo
- - (void)viewDidLoad {
- [super viewDidLoad];
- self.myLabelTwo.text = [(ViewControllerOne *)self.navigationController.presentingViewController myLabelOne].text;
- }
- @end
Add Comment
Please, Sign In to add comment