I have this line of code:
__weak NSBlockOperation *weakOperation = operation;
which is triggering this compiler error:
__weak attribute cannot be specified on automatic variable.
Reason for this is I don't have ARC enabled (not ready to make the switch just yet). So from another StackOverFlow question, I was recommended to use:
__unsafe_unretained NSBlockOperation *weakOperation = operation;
Which makes the error go away, but for the context I'm using it, it's not working (see this question if interested: How to cancel NSOperationQueue).
So my question is, what I can substitute the __weak
keyword with in this instance to get rid of this warning? Everything actually works correctly when I use __weak
, but I'm afraid it won't hold up over future versions of iOS.