2010-04-20 28 views
0
while(sqlite3_step(compiledStatement) == SQLITE_ROW) { 
    // Read the data from the result row 
    NSLog(@"WHILE IS OK"); 

    //// THIS NEXT STATEMENT //// 
    NSString *araci = [[NSString alloc] stringWithUTF8String:(char *) 
      sqlite3_column_text(compiledStatement, 1)];** 

    [deneme addObject:araci]; 

    NSLog(@"Data read"); 
    NSLog(@"wow: %",araci); 
} 

检索值,则抛出一个异常象下面这样:我无法从我的表

[NSPlaceholderString stringWithUTF8String:]: unrecognized selector sent to instance 0x3d0c0c0' 

什么是与指定的语句问题?我用sqlitemanager。我在我的表相对id(integer), name(text), desc(text) 3个属性。另外,我有一行例如。我无法检索该名称。

回答

0

你调用stringWithUTF8String:上NSString的方法,该方法返回一个字符串,自动释放 - 所以你不需要ALLOC通话了。该行应为:

另外,顺便说一句,在最后一行您的NSLog电话是不太正确的 - format specifier应该是%@,而不仅仅是%,因为你在一个NSString投入:

NSLog(@"wow: %@",araci); 
+0

非常感谢兄弟们.. – user310000 2010-04-20 11:23:02

+0

没问题!希望它解决。 – bio18 2010-05-10 23:09:02