lets say i have a mainView, from it i pushed to subView.
i can send value from subView to mainView by this code
mainView *main = [[mainView alloc] initWithNibName:nil bundle:nil];
main.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:main animated:YES];
this code well send a textfield value from subView To mainView
NSString *text1 = field1.text;
[[mainView label1] setText:[NSString stringWithString:(NSString *)text1]];
what if i have an action called action1 in mainView and i want to call it when i come back from subView ? what is the code for that ?
thank you in advance 🙂
In your subView (where you want to call) put
In your mainView (viewDidLoad) put
Your main will call the method
yourMethodNamewhen the postNotification is executed.