views:

84

answers:

1

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?

+4  A: 

stringByReplacingOccurrencesOfString returns an already autoreleased object.

You don't need to release or autorelease it.

diciu