I am making a call to a database. After my call, I’ve found leaks in NSString. Anybody have a solution to remove it?
NSString *pic = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectStatement, 5)];
In above code, I found 90% leaks. I just read data from database.
please explain the question well else others can’t identify your exact problem.
I think you are you are assigning the value of [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectStatement, 5)]; to your class object property.
You can release the assigned class string property in the corresponding class dealloc method.Also set it nil.
Example:
if you are doing
the class structure will like
.m file will be
Check it.. this structure will not show memory leak.