Clang 静态分析器对自动释放发出警告
结果 = [结果 stringByReplacingOccurrencesOfString:@"§" withString:@"c"];
结果 = [结果 stringByReplacingOccurrencesOfString:@"à" withString:@"c"];
clang 静态分析器给出警告“方法返回一个具有 +0 保留计数(非拥有引用)的 Objective-C 对象”
return [result autorelease];
“对象过度自动释放:对象已发送-自动释放,但该对象的保留计数为零(本地可见)”
您对此警告有任何了解吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
stringByReplacingOccurrencesOfString 返回一个已经自动释放的对象。
您不需要释放或自动释放它。
stringByReplacingOccurrencesOfString returns an already autoreleased object.
You don't need to release or autorelease it.