Cocos2d开发之如何在Cocos2d项目中启用ARC机制(Build the cocos2d code as a Static Libary)

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 EditRefactorConvert 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. 




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值