iPhone 4 iOS5 Core Plot and ARC error:"The current deployment target does not support weak references"

Alex Stone picture Alex Stone · Oct 14, 2011 · Viewed 13.1k times · Source

I've converted my project to iOS 5 and enabled ARC. Now I need to integrate core plot with the project. When I try to instantiate a sample controller included with the Core Plot, I get about 20 errors as follows:

The current deployment target does not support automated __weak references

I've explicitly said fno-objc-arc next to the controller's name in the build settings.

What else do I need to run core plot with ARC enabled?

Thank you!

Answer

FeifanZ picture FeifanZ · Oct 14, 2011

__weak references only work on iOS 5 and above. If you have the deployment target set to anything earlier, then you'll get the error. Basically, if you want to deploy to earlier devices you can't use automated __weak references. The substitute would be __unsafe_unretained