ofxSQlite on the iPad issues

I’m building an iPad app that’s a sort of cellular life simulation / generative music app. Anyhow, I need a database to store / load / save information too. Anyhow, texted out ofxSQlite on 007osx of OF and figured out how I’d need to structure my DB and make calls, insert, etc. Everything worked after I just made the adjustments mentioned on gitHub https://github.com/roxlu/ofxSQLite/issues.

Sweet.

All right, so I then tried implementing a super simple example using of_preRelease_v007_iphone just too see if there’d be any issues. All of the ofxSQlite files compile just fine, but it never finds my database file, basically just flags and tells me it can’t find the table I’m searching for. I have my db set at the same path level as in my OSX file. Does OF_iPhone build default to looking at a different path? Or is there a larger incompatibility issue between ofxSQlite OF_iPhone?

Anyone know a fix?

  
#pragma once  
  
#include "ofMain.h"  
#include "ofxiPhone.h"  
#include "ofxiPhoneExtras.h"  
#include "ofxSQLiteHeaders.h"  
  
class testApp : public ofxiPhoneApp {  
	  
public:  
    testApp();  
	void setup();  
	void update();  
	void draw();  
	  
	void touchDown(ofTouchEventArgs &touch);  
	void touchMoved(ofTouchEventArgs &touch);  
	void touchUp(ofTouchEventArgs &touch);  
	void touchDoubleTap(ofTouchEventArgs &touch);  
  
	float appIphoneScale;  
      
    string key;  
    vector<string> chords;  
  
private:  
    ofxSQLite* sqlite;  
};  
  

  
#include "testApp.h"  
#include "stdio.h"  
  
//--------------------------------------------------------------  
testApp::testApp(){  
    key = "Db";  
      
	sqlite = new ofxSQLite("music.sqlite");  
      
    ofxSQLiteSelect sel = sqlite->select("id, name, chords").from("keys");  
    sel.execute().begin();  
      
    //look through the DB and grab all the chords that match the key  
    while (sel.hasNext()) {  
        int id = sel.getInt();  
        string name = sel.getString();  
        if (name == key) {  
            string dbChords = sel.getString();  
            string buf; // Have a buffer string  
            stringstream ss(dbChords); // Insert the string into a stream  
              
            while (ss >> buf) {  
                chords.push_back(buf);  
            }  
        }  
        sel.next();  
    }  
      
    //fug it lets just see if it works  
    cout << chords[0] << endl;  
}  
  

Hi,

I have similar problem and I post here some code: http://forum.openframeworks.cc/t/read-write-example-of-sqlite-in-ios/7659/0

Well I had no problem to read database, but I actually get working in simulator write and read well. But then in device using iphone 4 seems to not work the write. I mean not seems that save the things in database.

Will be nice to find how to save data properly in SQLite in any way.