I'm using XCode 4.6.2 and also I'm new to iOS development. I'm trying to install the the AFNetworking library, but I get the following error when I'm trying to use it : "The current deployment target does not support automated _weak references"
(when I try to display an image from an URL) in the files AFHTTPClient
and AFURLConnectionOperation
.
I don't have any weak properties in my little first project but only strong ones.
Any advice would be great!
Thank you
Weak references are only supported with iOS 5.0 and later. If your deployment target is set to 4.3 then you can't use weak
. The error is probably coming from AFNetworking.
Drop support for iOS 4.3 if you can or don't use AFNetworking.
To target the older OS, you can use unsafe_unretained instead of weak
in your property declaration, and it should mostly work the same way. weak references nil themselves when their target goes away, but unsafe_unretained leaves open the possibility that the object you're linking to could turn into a dangling pointer when it is deallocated. The latter is the same behavior as if you had used assign
as a property declaration in manual memory management.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With