Is there a correct way to do lazy sql writes to a database in iOS if you don’t know when your app will be terminated and you need that information? I want to minimize the amount of calls to saveToDatabase while still maintaining all the data I need?
Share
Apple recommends saving your data when your app delegate receives the
applicationDidEnterBackground:message. If you’re targeting pre iOS 4.0 you’ll want to do this in theapplicationWillTerminate:method as well.