In our iPhone app we have a controller ‘AddViewController’ which shows a data entry screen to add a new entry. It includes Save and Cancel buttons.
Currently if a user enters nothing at all in any of the text fields and presses Save the app crashes.
(Yes I know it’s silly for someone to do this, but hey just covering off on everything)
How to handle the save scenario above so the system doesn’t crash or save a blank record and just returns gracefully to the previous page like Cancel?
You should check each field for valid input, and then display an alert view if anything is invalid.
If you don’t want to alert the user and just return without saving a blank document, then you should still check for valid input and only commit data that is valid.