开发者

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 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜