AFNetworking: current deployment target does not support automatic links

I am using Xcode 4.6.2 and also I am new to iOS development. I try to install the AFNetworking library, but I get the following error when I try to use it: "The current deployment target does not support automated _weak references" (when I try to display the image from the URL) in the AFHTTPClient and AFURLConnectionOperation .

I do not have weak properties in my small first project, but only in strong ones.

Any advice would be great!

thanks

+4
source share
2 answers

Weak links are only supported with iOS 5.0 and later. If the deployment target is set to 4.3, you cannot use weak . The error probably came from AFNetworking.

Drop support for iOS 4.3 if you may or may not use AFNetworking.

+12
source

To target an older OS, you can use unsafe_unretained instead of weak in the property declaration, and it should work basically the same. weak references are null when their target leaves, but unsafe_unretained leaves open the possibility that the object you are communicating with may turn into a dangling pointer when it is freed. The latter is the same behavior as if you were using assign as a property declaration in manual memory management.

+2
source

All Articles