2
votes

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?

1

1 Answers

4
votes

stringByReplacingOccurrencesOfString returns an already autoreleased object.

You don't need to release or autorelease it.