Question

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?

Was it helpful?

Solution

stringByReplacingOccurrencesOfString returns an already autoreleased object.

You don't need to release or autorelease it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top