Xcode 7.3b4, non-arc, cannot create __weak reference
| Originator: | skyriser | ||
| Number: | rdar://24791037 | Date Originated: | 23-Feb-2016 10:35 AM |
| Status: | Open | Resolved: | |
| Product: | Product Version: | ||
| Classification: | Reproducible: |
Summary:
Using sample new app code, and adding this line to create a weak self (see screenshot and attached sample code):
__weak AppDelegate* weakSelf = self;
using latest stable Xcode release 7.2.1, it's working fine.
But on latest Xcode beta 7.3b4, it's giving me the error:
/Users/ccomeau/Documents/Temp/Test1/Test1/AppDelegate.m:22:3: error: cannot create __weak reference in file using manual reference counting
__weak AppDelegate* weakSelf = self;
Steps to Reproduce:
see description
Expected Results:
see description
Actual Results:
Version:
Xcode 7.3b4 , Mac OS X 10.11.3
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!
This issue behaves as intended based on the following: We are in the process of implementing weak references in all Objective-C language modes. Since “__weak” has historically been ignored in non-ARC (and non-GC) language modes, we’ve added this error to point out places where the semantics will change in the future. Please update your bug report to let us know if this is still an issue for you.