开发者

Clang static analyzer gives warning over autoreleased

开发者 https://www.devze.com 2022-12-15 21:20 出处:网络
result = [result stringByReplacingOccurrencesOfString:@\"ç\" withString:@\"c\"]; result = [result stringByReplacingOccurrencesOfString:@\"Ç\" withString:@\"c\"];

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 obje开发者_JAVA百科ct 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消