I have 2 view controllers MainDetailViewController
(MD) and MainEditViewController
(ME)
There is a textView in MD with some text already there when view loads. Then I call ME like this
MainEditViewController *editVC = [[MainEditViewController alloc] init];
editVC.theTextView.text = self.theTextView.text;
UINavigationController *navCon = [[UINavigationController alloc] initWithRootViewController:editVC];
[self.navigationController presentViewController:navCon animated:YES completion:nil];
I am passing the TextView's text value to ME like above and calling it with presentViewController method.
In ME I edit the text and click on save button which should update the text value in MD's textView
MainDetailViewController *mainDetailVC = [[MainDetailViewController alloc] init];
mainDetailVC.theTextView.text = self.theTextView.text;
[self dismissViewControllerAnimated:YES completion:nil];
This is not reflecting change in MD
What am I doing wrong?