Puzzling Analyzer output
Puzzling Analyzer output
- Subject: Puzzling Analyzer output
- From: Matt Gough <email@hidden>
- Date: Thu, 1 Apr 2010 10:56:50 +0100
When running the analyzer on my app, I get the following warning:
warning: Object with +0 retain counts returned to caller where a +1 (owning) retain count is expected
return data;
^
in the following method
- (NSData*) dataNoCopyForColumnIndex:(int)columnIdx {
if (sqlite3_column_type(statement.statement, columnIdx) == SQLITE_NULL || (columnIdx < 0)) {
return nil;
}
int dataSize = sqlite3_column_bytes(statement.statement, columnIdx);
NSData *data = [NSData dataWithBytesNoCopy:(void *)sqlite3_column_blob(statement.statement, columnIdx) length:(NSUInteger)dataSize freeWhenDone:NO];
return data;
}
I can't see anything wrong with the code, and its a common enough pattern to return autoreleased objects.
Is this just a false positive, or is there something obscure I am overlooking related to the NoCopy version of dataWithBytes?
Thanks
Matt _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden