iPhone: Save with validation on back navigation
- by iPhone beginner
In my iPhone application I have navigation controller, main screen and some edit screens. On edit screen user does some input that has to be validated before I can save it. Ideally I would like to update data automatically on back navigation without additional "Done" button. Can I do some validation and save on back navigation (i.e. when user taps on standard back button) in a way that allows my to stop navigation and show some error message if something is wrong?
I see several other possibilities:
Create my custom left button and make it looks like standard back. (Why Apple didn't put this button style into public API?)
Add "Done" button and save data only if user taps it
but both these choices I like much less. So if there is a way to achieve what I want, I'd like to use it.