Potential Leak, assigning NSString-Property to UIL

2019-07-15 20:21发布

When I analyze my code it shows up a potential leak when I assign a Core Data String-attribute to a UILabel

cell.textLabel.text = prop.new_value;

Running the App with Instrument and Leaks doesn't show any problem.

1条回答
在下西门庆
2楼-- · 2019-07-15 20:54

The static analyzer understands certain cocoa conventions such as methods beginning with "new" returning a retained object pointer.

I would suggesting changing "new_value" in prop.new_value to something different.

Source: http://clang.llvm.org/docs/AutomaticReferenceCounting.html#objects.operands.retained_returns

查看更多
登录 后发表回答