I decided today to upload my iOS8 app to iTunes Connect to try out TestFlight. That worked fine, until I tapped on one of the tableviews and the app crashed. After half a day figuring out how to debug a released app, I finally was able to pinpoint the crash. To be clear, this only happened on the release version. Debugging never let the program crash here on my wifes phone, my own or any emulator.
The app crashed on the following line:
folderID = folder.folderID as Int
I did that, since folder.folderID
is a NSNumber
and I used this method many times before to get something similar done.
My app runs fine now by casting folder.folderID
to an Int
using:
folderID = Int(folder.folderID)
So my question is not directly how to resolve my bug, but more what could have happened here, since it did not crash while debugging all the time. But now I uploaded the app and tested it on a few devices it crashed here.
And `folder.folderID' only returns whole Integers.
Should I review my previous methods to ensure it might not be crashing material in the future?