Mutility 1.0.2
/This thing above is the invitation to integrate Crashlytics into mutility. After the terror of having a crash in 1.0.0 with no way to see what's going on, it was clearly time to get some insight into future problems (that will never happen, right?). Crashlytics is a sponsor of marco.org, which is where I first heard about them, and before this version even hit App Store review, it saved my butt. But first, here's what's new:
- Fixed bug where intermittent network activity could cause a crash when leaving the Settings or History screens
- Changed history table segue to modal and the animation to a flip – works much better with my mental model of how it should work (history lives on the back, not off to the side)
- Integrated Crashlytics
- Improved dice rolling randomness
- Added a 'Leave a Review' button in Settings
- Various back-end clean-up and optimizations
Crashlytics & Its Big Find
While playing with the 1.0.2 beta and quickly flipping back and forth between the settings screen and the main screen, it suddenly crashed. I was in an area of very poor cell reception, and had noticed that it couldn't fetch the in app purchase price from the store. The app re-launched no problem (something that would NOT have happened in 1.0.0), and shortly thereafter I got an email from Crashlytics. It had crashed in the request:didfailwitherror: method in the in app purchase handling class with
Exception Type: EXC_BAD_ACCESS
Code : KERN_INVALID_ADDRESS at 0xc
A quick Google search found that this is an error typical of sending messages to deallocated objects. Well, the request:didfailwitherror: method sends a completion block to the Settings and History view controllers. After about a half hour of digging around, I discovered that I was not properly unregistering these view controllers from Notification Center (I was unregistering in viewdidunload, which is deprecated, womp). In spotty cell reception, sometimes you've already dismissed the Settings or History screen before the in app purchase price is loaded from the store. If you don't unregister that guy as an observer, a notification will get sent into the bit bucket and you'll have a crash.
This issue was fixed (geeze, I hope) by unregistering the Settings and History view controllers as notification observers in viewwilldissappear:animated.