Background
I published version 1 of my app before Alloy was released, and I am now preparing to publish an update which is the entire app rewritten using Alloy.
in the first version of the app I used an sqlite database to track the reports submitted by the user. In the Alloy version of the app I am storing this information in a collection (which is again stored with sqlite).
Problem
What I want to do is: Get every record from the old .sqlite database (which was stored in Resources / models) and store them as models in my Alloy collection.
This works fine in the simulator. I have tried it a few times, and it works no worries. But It doesn't work on my iPhone. The code that causes the error is::
var databasePath = '/models/app_data.sqlite', databaseName = 'databaseName'; //check for previous reports var db = Ti.Database.install(databasePath, databaseName); db.execute('SELECT * FROM savedRecords');
Summary
If I install the first version of my app on my iPhone this same code still works fine.
If I run this code in my alloy app in the simulator it works fine.
If I run this code in my alloy app on my device is fails and gives the error "db is not an Object"
I am testing with an iPhone 3GS running iOS 6 Alloy 1.1.3 Titanium 3.1.1
Any help would be greatly appreciated.