Mutility 1.0.1

This is a bug fix version (with very minor other updates) targeted at fixing a rare crash and a more serious crash. Read on for the dirty laundry.

Update Overview

Status: Submitted 5/28/11 and waiting for review.

  • Fixed: History table editing crash
  • Fixed: Database integrity
  • Very minor UI tweaks and some new messages during in-app purchasing

Fixed: History Table Editing Crash

Problem: When a user swipes a cell in the history table to delete it, but instead dismisses the history table, the app would crash after a slight delay. This one didn't come up in beta testing, and just goes to show the weird edge cases you need to somehow predict as a developer.

Fix: This SO thread tipped me off that methods can still be called on the table after it's been dismissed, in particular one relating to the editing state of the cells. By forcing the editing state to be off before the table disappears, these methods will no longer be called. 

Fixed: Database Integrity 

What: Should the app get killed or experience an issue when the initial database is created the first time the app is downloaded (or perhaps even during an update), the database could be corrupted in such a way that the app crashes almost immediately after opening. The user would have to delete the app and reinstall to stop this crashing nonsense. My apologies to @MattMarks_ for being the unlucky one to experience this.

Fix: This issue was 100% caused by my inexperience with Core Data. The database back-end of this app is built on Core Data via a UIManagedDocument. This is how I achieve persistence of user settings, life transactions, etc.  There were several instances where I was not handling database errors at all (aside from a comment to the tune of //NEED TO HANDLE THIS), and I wasn't doing enough checks to see if something had gone wrong. Now, the database is checked and rebuilt if there is an issue. More work needs to be done on this to assure preservation of existing data (instead of wholesale wiping the thing out and starting fresh), but I need to get smarter in this area first.