//opening DB
if(sqlite3_step(statement) == SQLITE_ROW)
result = [NSString stringWithUTF8String:(char*)sqlite3_column_text(statement,0)]; //!
else
result nil;
return result;
//close DB
views:
108answers:
2
A:
the string should be autoreleased by stringWithUTF8String, are you testing for memory leaks on the iPhone or on the simulator? Often the simulator code is just a touch buggier - try it on the device itself
Rob Fonseca-Ensor
2009-12-26 07:41:19
yes i'm testing on a simulator, cause the device debugging is really slow:( 10x for answers, probably it's a buggy simulator
max
2009-12-26 08:17:00
+2
A:
This is actually not a memory leak. The NSString will be autoreleased, and the char*
returned by sqlite3_column_text
will be cleaned up by sqlite during the next step/reset/finalize call.
Terry Mahaffey
2009-12-26 08:07:33