1、Build the cocos2d code as a static Library
cocos2d may be compatible with ARC,but the cocos2d source code is not compliant with ARC.
The best way to do this is to build the cocos2d code as a static library,allowing the code to be build without ARC.Then you can safely link the cocos2d static library
with you application's target,which has ARC enabled.
First,locate and delete the libs group in the Navigation area,click Remove References.
Second,Add Target,navigate to the Framework & Library group and Select Cocoa Touch Static Library.Then click Next.
Name the static library appropriately,deselect both include Unit Tests and User ARC.
After creating the cocos2s-library target,select it,and the Build Setting pane is shown.You need to browse the Build Setting to make two changes in the Search Paths
section.Set the Always Search User Paths setting to YES and set the User Header Search Paths to the ./** string.
Now select the other target of the project.That's the one that was already there when you created the project.Select the Build Phases tab and expand the LinkBinary With Libraries list.Click the small + button below the list. Select the library you add. Then add file,chose the project libs and add,chose the create groups for any added folders.
2、 Refactor the Project's Source Code the ARC
edite---refactor--covert oc arc.
本文介绍如何通过构建Cocos2d为静态库来避免自动引用计数(ARC)冲突,包括删除libsg组、添加静态库目标、配置构建设置及链接库等步骤,并提供了重构项目源代码以兼容ARC的方法。
1583

被折叠的 条评论
为什么被折叠?



