I have two embedded views in a combined uiview controller. They are passed a user object when the prepareforsegue method is called. This looks like this:
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
if ([segue.identifier isEqualToString:@"EditSegue"]) {
self.userSubViewController = segue.destinationViewController;
self.userSubViewController.user = self.user;
}
I also have a modalviewcontroller
called MessageCreationViewController
that receives input from the user and then returns to the combinedviewcontroller
via an unwind segue. It returns to a done method that looks like:
- (IBAction)done:(UIStoryboardSegue *)segue{
MessageCreationViewController *messageController = segue.sourceViewController;
User *user = [[User alloc] init];
user.description = messageController.message;
self.userSubViewController.user = user;
}
I would like userSubViewController
to reflect the input data from the modal view, but this does not occur because the prepareforsegue
method is not triggered again. Pushing the user object at the end of the done method does not update the view.
Also the viewDidLoadMethod
from the userSubVewController
is not called again. That currently looks like:
- (void)viewDidLoad
{
[super viewDidLoad];
self.label.text = [self.user message];
}
What do I need to do to trigger and update in the user object of the userSubViewController
?
Thanks!