Showing posts with label arc. Show all posts
Showing posts with label arc. Show all posts

Friday, June 13, 2014

@synthesize of 'weak' property is only allowed in ARC or GC mode

Getting an error like "@synthesize of 'weak' property is only allowed in ARC or GC mode" when the project is already in ARC is pretty confusing.  I had imported and converted a non-arc class which started this problem.  After using Xcode's Edit -> Refactor -> Convert to Objective-C ARC on that class the errors started popping up for other classes that were originally in the project.  In the end i had to convert the whole project for the errors to go away.

Thanks to Buzzwig on this page
 http://stackoverflow.com/questions/12434127/refactoring-to-arc-results-in-synthesize-of-weak-property-is-only-allowed-in

Saturday, May 31, 2014

How to Assign specific compiler flags to specific files

I recently needed to add an ARC file to a non-arc enabled project.  There were compiler warnings saying the -fobjc-arc flag needed to be added for the file.  To do this in Xcode go to Targets -> Build Phases -> Compiler Sources.  Then find the file and add the flag.

http://stackoverflow.com/questions/8768176/how-to-add-arc-for-specific-file