Created
December 29, 2011 02:08
-
-
Save benbahrenburg/1531165 to your computer and use it in GitHub Desktop.
Per iOS 5 Ti 1.8 Way to find your SQLite file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fetchDbFile(dbName){ | |
Ti.API.info('We build the directory path to find ' + dbName + '.sql'); | |
return Ti.Filesystem.getFile(Ti.Filesystem.applicationSupportDirectory, 'database', dbName + '.sql'); | |
}; | |
var myDbName = 'foo123'; | |
Ti.API.info('We create a db to test our method') | |
var testDb = Ti.Database.open(myDbName); | |
Ti.API.info('No we get the file') | |
var dbFile = fetchDbFile(myDbName); | |
Ti.API.info('Did we find it? ' + dbFile.exists()); | |
Ti.API.info('Here is the nativePath ' + dbFile.nativePath); | |
Ti.API.info('Example Finished'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please note this will not work in Titanium 1.8 on iOS 5