sqlite проблемы с xcode - PullRequest
       2

sqlite проблемы с xcode

0 голосов
/ 26 марта 2011

Получение sigabrt дает сбой при обновлении sqlite.Бороться с этим в течение последних 3 часов, и я близок к восстановлению, но подумал, что я попробую здесь сначала.Используя этот превосходный файл sqlite / xcode, найденный на dblog.com.au, он, похоже, рушится на этом этапе.Спасибо!

-(void) readAnimalsFromDatabase {

sqlite3 *database;


animals = [[NSMutableArray alloc] init];if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) {

    const char *sqlStatement = "select * from animals";
    sqlite3_stmt *compiledStatement;
    if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) {
    while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
NSString *fName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 1)];
NSString *fDescription = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 2)];
NSString *fImageUrl = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 3)];
NSString *cName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 4)];
NSString *cDescription = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 5)];
NSString *cImageUrl = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 6)];

Animal *animal = [[Animal alloc] init: animal:fName description:fDescription url:fImageUrl cname:cName cdescription:cDescription cimageurl:cImageUrl];


[animals addObject:animal];

[animal release];
        }
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...