jeudi 11 juin 2015

database wrong in objectivec

I have a set of database in my project. But I got Error "Thread 1:signal SIGABRT" I don´t know what wrong here ? I use

NSMutableArray* vvv=[[NSMutableArray alloc] init];
NSString *ask = [NSString stringWithFormat:@"SELECT mycolumn FROM tb_ordbok WHERE ID  =\"%ld\"", (long)indexPath.row+1];

sqlite3_stmt *statement;
const char *query_statement = [ask UTF8String];
const char *dbpath = [_DBPath UTF8String];
if (sqlite3_open(dbpath, &_iDB) == SQLITE_OK)
{
    if (sqlite3_prepare_v2(_iDB, query_statement, -1, &statement, nil) == SQLITE_OK)
    {

            NSString *riseruto = [[NSString alloc] initWithUTF8String:(const char *)sqlite3_column_text(statement, 0)];
           [vvv addObject:riseruto];

        sqlite3_finalize(statement);
        sqlite3_close(_iDB);
    }
}

Aucun commentaire:

Enregistrer un commentaire