I have a form with some text fields, toggles and pickers. Everything works just fine except for When I input something on text fields and click cancel button and reopen the form, inputs are still there. Just can't figure out why.
Now, the app I'm working on is huge. Therefore, can't share everything but here's how my btnCancelClicked method looks like:
- (IBAction)btnCancelClicked:(id)sender {
if(onCompletion) {
onCompletion(self.myView, YES);
}
}
What's the logic behind implementing a cancel button? What is the step by step process to close the view and not saving whatever the user input is? I'd like to understand what the problem behind this might be. I appreciate any help.
Edit: [self.myView setNeedsDisplay];
or [self.myView setNeedsLayout];
are not helping.
Edit2: TextViews are also working properly, meaning that when I type something and then click cancel and reopen the view is at its initial state. The only problem is with TextFields. Should I do something different for them?
After dismissing the view, the view is still in memory. So you get all the entered value as it is. you have two way to achieve your desired outcome:
you mentioned TextViews are working perfectly, is TextViews created manually?