Clang static analyzer gives warning over autoreleased

result = [result stringByReplacingOccurrencesOfString:@"ç" withString:@"c"];

result = [result stringByReplacingOccurrencesOfString:@"Ç" withString:@"c"];

clang Static analyzer gives warning "Method returns an Objective-C object with a +0 retain count (non-owning reference)"

return [result autorelease];

" Object over-autoreleased: object was sent -autorelease but the object has zero (locally visible) retain counts "

Do yo have any idea about this warning?


stringByReplacingOccurrencesOfString returns an already autoreleased object.

You don't need to release or autorelease it.

链接地址: http://www.djcxy.com/p/43728.html

上一篇: 功能

下一篇: Clang静态分析仪对autoreleased发出警告