I am pushing viewControllerB from A as,
if(!self.controller2){
self.controller2 = [[viewControllerB alloc] initWithNibName:@"viewControllerB" bundle:nil anUser:self.idUser aidioma:self.idioma];
}
[[self navigationController] pushViewController:self.controller2 animated:NO];
Then, I pop B to A. Now need to push A again but initializing again B or calling function on B in order to pass new vars. Following options could be valid but I’ve got no success,
- Release controller2 and = nil, but IF sentence is not executed because controller2 still active!
- Call function on viewControllerB in order to pass new pars without init but function is not called.
What am doing wrong? Thanks.
Try to Use
NSNotificationCentercheck this Link which Describes it Properly.Send and receive messages through NSNotificationCenter in Objective-C?
use This Code in your Class A
viewDidLoad:Use the following Code in your Class B pop function.