Cocos2d开发之如何在Cocos2d项目中启用ARC机制(Build the cocos2d code as a Static Libary)
2012-11-08 02:05
369 查看
1.locate and delete the libs group in the Navigation area(Remove but not trash the libs group from the project)
2.Select the Project itself in the Nevigation area, then click the Add Target button at the bottom
3.navigate to the Framework & Librarygroup and select Cocoa Touch Static Library. Then click Next.
4.Name the static library appropriately—for example, cocos2d-library would
be a good name.Besure to deselect both Include Unit Tests and Use Automatic Reference Counting.
5.Set the Always Search User Paths setting to Yesand set the User Header Search Paths to the somewhat cryptic ./** string.
6.Select the Build Phases tab and expand the Link Binary With Libraries list.
7.Click the small + button below the list to bring up the selection dialog shown in Figure down.From
that, select the libcocos2d-library.a entry and click Add.
8.Click File Add
Files to“name-of-project” to bring up the file dialog shown in Figure down
9.Locatethe cocos2d-library.h and cocos2d-library.m files
in the navigation area and delete the files.It’s just an empty stub class that Xcode always creates when adding a static library target.
10.From the Xcode menu choose EditRefactorConvert to Objective-C ARC.... This brings upthe dialog shown in Figure down, where
you can select the targets to convert. Select only yourapp’s target and not the cocos2d-library target. Then click Check.
11.Read the text and click Next. The dialog shown in Figure down allows
you to reviewthe changes it is about to make. You can safely accept them all by clicking Save.
2.Select the Project itself in the Nevigation area, then click the Add Target button at the bottom
3.navigate to the Framework & Librarygroup and select Cocoa Touch Static Library. Then click Next.
4.Name the static library appropriately—for example, cocos2d-library would
be a good name.Besure to deselect both Include Unit Tests and Use Automatic Reference Counting.
5.Set the Always Search User Paths setting to Yesand set the User Header Search Paths to the somewhat cryptic ./** string.
6.Select the Build Phases tab and expand the Link Binary With Libraries list.
7.Click the small + button below the list to bring up the selection dialog shown in Figure down.From
that, select the libcocos2d-library.a entry and click Add.
8.Click File Add
Files to“name-of-project” to bring up the file dialog shown in Figure down
9.Locatethe cocos2d-library.h and cocos2d-library.m files
in the navigation area and delete the files.It’s just an empty stub class that Xcode always creates when adding a static library target.
10.From the Xcode menu choose EditRefactorConvert to Objective-C ARC.... This brings upthe dialog shown in Figure down, where
you can select the targets to convert. Select only yourapp’s target and not the cocos2d-library target. Then click Check.
11.Read the text and click Next. The dialog shown in Figure down allows
you to reviewthe changes it is about to make. You can safely accept them all by clicking Save.
相关文章推荐
- Cocos2d-x 3.2 大富翁游戏项目开发-第二十部分 螃蟹挡路(code)
- iOS开发实战:如何将非ARC的项目转换成ARC项目
- Cocos2d-x游戏开发之Mac下Android如何更新项目代码
- iOS开发实战:如何将非ARC的项目转换成ARC项目
- iOS开发:ARC下内存回收机制详解,及如何防止内存泄漏
- 如何新建Cocos2d开发iPad版项目
- 转换文件[Cocos2D 2.x iOS 开发笔记2] 在Project中启用ARC
- iOS开发实战:如何将非ARC的项目转换成ARC项目
- Cocos2d-2.x开发之修改cocos2d-2.x-ARC-iOS ARC模板的项目名
- 如何使用Visual Studio Code开发Django项目
- [Cocos2D 2.x iOS 开发笔记2] 在Project中启用ARC
- 开发工具:AS如何正确导入下载的开源项目
- [Cocos2d-x开发问题-1] 如何新建一个Cocos2d-x项目
- iOS开发实战:如何将非ARC的项目转换成ARC项目
- cocos2d-x开发: 如何从项目中分离出接口范例
- iOS开发实战:如何将非ARC的项目转换成ARC项目
- 研发人员如何看待项目开发管理
- 在项目开发中,jsp页面不会少了,如何公用页面(添加页面和修改页面)和公用样式代码(css,js)?
- AgileEAS.NET平台开发案例-药店系统-项目说明
- VSCode配合chrome浏览器调试cocos2d js项目