我有一个从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
如果我不发布数据,该应用程序运行正常
答案 0 :(得分:1)
这是非常奇怪的行为,我很乐意深究它。但是现在,自动发布您的数据字符串。
data = [[[NSString alloc] initWithUTF8String:(const char *)sqlite3_column_text(statement,2)] autorelease]