Question

I'm trying to convert an older project to ARC. My project relies on Cocos2D, which is a 3rd party non-ARC library. All the Cocos2D source files are part of a separate target and are compiled to a static library.

However, the ARC migrator returns ARC semantic issue errors in Cocos2D source files, even though they're not part of the main target I'm trying to convert.

What could be the reason for this? That source code shouldn't matter, right?

Was it helpful?

Solution

In general, the safest thing is to not perform ARC conversion on code that is not yours. Therefore, you could just tell the compiler to not use ARC with the Cocos2D code, by going into your "Build Phases" on your target's settings, add the -fno-objc-arc flag as described in the Transitioning to ARC Release Notes. You just expand the "Compile Sources" section of the "Build Phases", double click on the Cocos2D source files, and then enter -fno-objc-arc in the pop up box.

Having said that, I appreciate that there might be a lot of .m files involved. As such there are sources out there that suggest different approaches to tackling Cocos2D and ARC, such as Enable ARC in a Cocos2D Project.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top