Re: Why doesn't this work on my device?
Re: Why doesn't this work on my device?
- Subject: Re: Why doesn't this work on my device?
- From: Stuart Malin <email@hidden>
- Date: Fri, 27 Feb 2009 08:44:38 -1000
<offlist>
On Feb 27, 2009, at 8:27 AM, James Cicenia wrote:
ARrrgh...
The database exists but it contains nothing?! I double checked it in
my trusty firefox sqlite extension, and everything is there.
Is there some magic "touch" I need to do to get the tables properly
into the device? I have cleaned my project, restarted xcode, rebuilt,
etc.
You may not be getting to your database file consistently. So while
you see content when viewing the file directly, you may not actually
be opening that file in your code.
You really should/must use fileSystemRepresentation and not UTF8String.
Someone wrote:
if (sqlite3_open([path UTF8String], &database) == SQLITE_OK)
Don't use UTF8String to get a C string for a file system path, you
should use -fileSystemRepresentation.
I don't even know what that is?
See:
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#/
/apple_ref/doc/uid/20000154-fileSystemRepresentation
I do my open this way:
result = sqlite3_open([[self databaseFilePath]
fileSystemRepresentation], &mSqliteDatabase);
And it works quite consistently and well.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden