Ben,
I don't actually have the book (though having responded to posts in this forum so often, I am thinking I should actually go through it!) The solution I proposed works fine with the downloaded source code. I have been unable to make it crash. Some of the issues with the project came about due to changes in the implementation of CoreData from iOS 3 to iOS 4, and also due to the introduction of multitasking and apps going to the background rather than terminating in iOS 4, since the projects were originally written in iOS 3.1.x or 3.2. I may pick up a copy of the book and do the project in iOS 5 to sort out the problem you are having. It doesn't make sense to have to delete the cache upon starting the app. That should be cleanup, not initialization.
Another thing that should be done is that the code in the
applicationWillTerminate⦠method should be moved to the
applicationDidEnterBackground⦠method since the applicationWillTerminate will rarely, if ever, be called. From the
applicationDidFinishLauching⦠signature you provided it appears that you did the program in iOS 5. Without having a copy of the book I don't know whether the downloaded projects have any discrepancies with the code as presented in the text, so just creating an iOS 5 project and copying the code from the download may or may not result in something comparable to what you have. It will be a couple of days before I can get my hands on a copy of the book.
Did you make any other changes to the program?
Would you mind sending a copy of your project for me to take a look at, and maybe I can see how it differs from the download that has been working for me?
Bob
[email protected]