Strong self capture should be explicit
| Originator: | robnapier | ||
| Number: | rdar://17315450 | Date Originated: | 14-Jun-2014 01:27 PM |
| Status: | Resolved: | ||
| Product: | Product Version: | ||
| Classification: | Reproducible: |
Accidentally capturing self in a retain loop is very common source of bugs in ObjC (so common that it generates warnings from the compiler). In any case that the compiler cannot prove that it is not a retain loop, "[strong self] in" or similar syntax (such as "strong(self).") should be required in closures. This couples with radar:17301343 which requests that self. aways be required rather than having it be used to signal a strong reference. That overloads its meaning too much.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!