@synthesize properties of "weak" is allowed only in ARC or GC mode with the first urbanship compilation

Basically, I have an iOS app that works without problems.

Following the instructions at http://docs.urbanairship.com/build/ios.html#ios-push-getting-started , I went to the Register your device "compile me." Section.

After trying to create code in xCode 5, I got the following error: "@implementation UAPushSettingsAddTagViewController @synthesize" weak "properties are allowed only in ARC or GC mode."

Note. ARC mode is not used.

+7
source share
2 answers

Find the “weak” in the project code and in the libraries you included. Change it to assign

Edit:

As @TaylorHalliday notes in his comment below, my answer was rather incomplete.

Changing weak properties for assignment will get rid of compiler errors, but this can potentially cause memory management problems if you do not understand how to use manual reference counting.

Since you use manual reference counting, you will need to go through your code and make sure that you save the objects you want to save, and then release all the links to the objects when you are done with them. An explanation of the details is beyond the scope of the forum publication. I suggest that you search in the “Memory Management” section of the Xcode Help and read the advanced memory management guide.

You should probably also run the analysis tool in your project to look for possible memory management issues.

Better yet, convert your project to ARC. It is much easier to avoid memory management issues when using ARC.

+16
source share

I have the same error when I added these two files to my project. My project was not included for ARC. First I needed to delete these files, and then I had to convert my project to ARC. Then adding these files did not cause errors.

+1
source share

All Articles