3-21 为cocos2d工程开启arc
2013-03-21 14:59
211 查看
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 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.
相关文章推荐
- 如何在一个开启了ARC的工程里使用不支持ARC的对象
- 老工程如何将ARC开启的问题
- cocos2d的ARC开启
- cocos2d-x的Android工程开启c++0x特性
- cocos2d的ARC开启
- 4000 Xcode工程中ARC的开启和禁止
- COCOS2D-X Battle 独立游戏 (二) 新建游戏主工程
- Cocos2d-x VS 工程创建问题
- 创建cocos2d-x工程及文件夹解析
- 在工程中使用Arc 和 非 Arc 的设置方法
- cocos2d_工程结构
- cocos2d-x 3.0 beta工程设置cdt调试
- Cocos2d-x项目移植到WP8系列之六:C#工程使用C++的DLL
- [转帖]Cocos2d-x 3.0rc0 的Win32工程添加CocoStudio库
- Cocos2d-x-lua工程的lua脚本加密
- 创建一个cocos2d-x工程添加一个自定义Scene并显示
- Cocos2d-x学习之创建Android工程和编译
- iOS 开发,工程中混合使用 ARC 和非ARC
- cocos2d-x-lua工程的lua脚本加密
- 用eclipse给cocos2d-x工程打android的apk包常见问题