Spatialite iOS5和xcode 4.5 – 无法准备语句:没有这样的函数:GLength

我在我的理智的尽头,试图让空间编译iOS6(或任何其他版本)xcode 4.5。 实际上,我可以使用基于为iOS构build静态库的技术来编译它- 特别是在控制台返回的时候,所有的都是oK,但是当我运行一个查询如

“通过GLength(几何)限制2从uk_highways中selectpk_uid”语句不会准备。

运行查询“从uk_highways限制2selectpk_uid”将返回2 id的即取出空间函数 – 工作正常(是的,表中有一个几何列)

我已经三天了,真的需要一些帮助,我讨厌这样说,但是我想我甚至需要一个“白痴指南”,如果有的话。

编辑:不知道为什么我没有包括这个第一轮:

-(int)getStreetLength { int length; NSString *databasePath = [[NSBundle mainBundle] pathForResource:@"dhub_spatial" ofType:@"sqlite"]; sqlite3 *db; if (sqlite3_open([databasePath UTF8String], &db) == SQLITE_OK) { NSLog(@"***** database opened ********"); spatialite_init(1); char *sql = "SELECT pk_uid from united_kingdom_highways where pk_uid < 100 order by GLength(Geometry) limit 2;"; sqlite3_stmt *stmt; if (sqlite3_prepare(db, sql, -1, &stmt, NULL) == SQLITE_OK) { NSLog(@"***** statement prepared ********"); while (sqlite3_step(stmt) == SQLITE_ROW) { NSLog(@"***** all the way throug to the while loop ********"); length = sqlite3_column_int(stmt, 0); NSLog(@"the value of pkuid is %i",length); } } else { NSLog(@"could not prepare statement: %s\n", sqlite3_errmsg(db)); //this returns no such function GLength } } return length; } 

    Interesting Posts