I use a sqlite database for a project. I can do queries like SELECT but impossible to do INSERTs! On the simulator the INSERT works properly. As soon as I compile on my iPod
-(void)createEditablecopyofDatabaseifneeded
{
BOOL success;
NSError *error;
NSFileManager *filemanagr = [NSFileManager defaultManager];
NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *dbPath = [path objectAtIndex:0];
NSString *finalDBPath = [dbPath stringByAppendingPathComponent:mDataBaseName];
self.mDataBasePath=finalDBPath;
success = [filemanagr fileExistsAtPath:finalDBPath];
if (success) {
}
else
{
NSString *writableDBPath = [[[NSBundle mainBundle]resourcePath]stringByAppendingPathComponent:mDataBaseName];
success = [filemanagr copyItemAtPath:writableDBPath toPath:finalDBPath error:&error];
self.mDataBasePath=writableDBPath;
}
if (!success) {
}
}
Check this before you create the DB in the document directory Hope this will help you