0

我有一个从 sqlite 数据库读取的应用程序,然后在每次单击按钮后在按钮中显示内容。

 NSString *data;    
 query = [NSString stringWithFormat:@"SELECT * FROM %@ WHERE ID=%d",TABLENAME,tempIndex];
 sqlite3_prepare_v2(contactDB,[query UTF8String],-1,&statement,NULL);
 sqlite3_step(statement);
 data = [[NSString alloc] initWithUTF8String:(const char *)sqlite3_column_text(statement, 2)];
 sqlite3_finalize(statement);
 [myButton setTitle:data forState:UIControlStateNormal];
 [data release];

但是,数据永远不会显示在按钮中,并且出现错误提示:

Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn:  dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: _CFXMLNodeGetInfoPtr

如果我不发布数据,应用程序运行正常

4

1 回答 1

1

这是非常奇怪的行为,我很想深入了解它。但是现在,自动释放您的数据字符串。

 data = [[[NSString alloc] initWithUTF8String:(const char *)sqlite3_column_text(statement, 2)] autorelease]

于 2012-09-11T17:17:35.187 回答