ios - Trying to set property in parent viewcontroller, but it ends up being Null -
I am in a view controller that was pushed onto the stack by a navigation controller.
I have this code that runs when the back button is pressed:
- (zero) didMoveToParentViewController: (UIViewController *) Parents {if ([[Parents! Axel: self.parentViewController]) {// NSLog (@ "back pressed"); MyCustomViewController * VC = [auto Storyboard InstantentibratorVidetifier: @ "Tabulvc"]; Vc.index = [_itemChooser selected ROYInComponent: 0]; }}
I am trying to set the pointer to the same index that I had selected in Picker view. If I do NSLog here, then this is true, but if I value the values in NSLog then in parent it is 0. (This prints as a tap if I am using an NSUntiger instead of something)
Pressed it like this:
[Self. Navigation controller Push ViewController: Animated pickervc: Yes];
I have resolved my problem by defining a visual controller property in the child class Before pushing it yourself. Then I was able to install / access the property to the parent from the child.
Comments
Post a Comment