Reveclair
Reveclair

Reputation: 2421

AFNetworking : the current deployment target does not support automated _weak references

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

Upvotes: 6

Views: 6374

Answers (2)

kunalg
kunalg

Reputation: 1580

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.

Upvotes: 2

rmaddy
rmaddy

Reputation: 318894

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.

Upvotes: 12

Related Questions