IOS memory leak from NSString
I have this code below and the leaks application is saying 100% of the leak is from this 开发者_开发知识库line of code.
const unsigned char *value = sqlite3_column_text(statement, number);
if(value)
return [NSString stringWithUTF8String:(char *)value]; //100%
return nil;
Can someone offer some insight on how to fix this.
I have this code below and the leaks application is saying 100% of the leak is from this line of code.
It doesn't mean the leak is there mate.
It shows where the leaked block was allocated, now you need to find where you retain it and don't release. For example, if you assign it to a retaining property, you'll need to add [<propertyname> release] in the dealloc method for the class that contains the property.
精彩评论