Simon,
Thanks a lot. This is just what I needed.
Greg
From: Simon Slavin <slav...@bigfraud.org>
To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
Sent: Wed, December 9, 2009 4:34:09 PM
Subject: Re: [sqlite] iPhone App close database
On 9 Dec 2009, at 11:13pm, Greg Walters wrote:
> I am looking for some general information regarding closing the sqlite
> database when used from an iPhone app. Since you never know when you app will
> go away, when do you close the database. I have found one example application
> that closes the database after getting data and doing updates. Most never
> close the database. What is the best way to handle this so in an iPhone app.
Your application does get warned about important like that, and is expected to
provide a routine to respond to each warning. Look for
applicationWillTerminate
for quitting, which is the question you asked. But also look for
applicationWillResignActive
applicationDidBecomeActive
since, if possible without too much extra work, I'd recommend that you also
close files while the iPhone is handling external interruptions like phone
calls, SMS notifications, and 'push' notifications. You might find this useful:
http://developer.apple.com/iPhone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ApplicationEnvironment/ApplicationEnvironment.html#//apple_ref/doc/uid/TP40007072-CH7-SW6
(that's all one long URL).
Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users