Skip to content
Tags

, ,

The current deployment target does not support automated __weak references

January 10, 2013

iOS developers will face this error when they start developing with ARC enabled for the first time.

Reason:

This happens because the least version required for using weak keyword is not set in the deployment target of the Target of the project. ARC  is available in iOS 4.0 but weak references are not supported in iOS 4.0 , but from iOS 5.0 weak references are also supported.

Solution:

1. If you do intend to support the versions below 5.0 from iOS 4.0, then use unsafe_unretained instead of weak

2. If you do not want to support the versions below 5.0, then change the Deployment Target in your targets to 5.0 or above.

Notes:

In addition to this there are several classes which can not use weak references:

http://stackoverflow.com/questions/9193445/weak-property-for-delegate-cannot-be-formed

http://developer.apple.com/library/ios/#releasenotes/ObjectiveC/ObjCAvailabilityIndex/_index.html

Advertisements

From → Apple, IDE, iOS, iPad, iPhone, Mac

One Comment
  1. Beginner iOS permalink

    Thank you! Solved my problem

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: