cocos2d是否支持ARC? [英] Does cocos2d support ARC?

查看:127
本文介绍了cocos2d是否支持ARC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Xcode 4.2和构建一个游戏的iphone(从iOS 3.0 - 5.0)。 cocos2d是否支持ARC?需要对以前版本中编写的代码进行哪些修改?

I am using Xcode 4.2 and building a game for iphone (from iOS 3.0 - 5.0). Does cocos2d support ARC? What modifications needs to be made to convert code written in previous versions?

如果我对变量使用strong和weak关键字,并将编译器设置为LLVM GCC 4.2,结果?是否需要将编译器更改为3.0以支持ARC?

If I use the strong and weak keywords for variables and set compiler to LLVM GCC 4.2, what will be the results? Is it a necessity to change compiler to 3.0 to support ARC?

推荐答案

Cocos2d v1.1和v2.0与ARC兼容。然而,cocos2d代码本身不使用ARC,并且没有cocos2d提供的模板,您可以使用它来开始使用ARC编程。您需要为cocos2d文件自己添加一个单独的静态库目标。

Cocos2d v1.1 and v2.0 are compatible with ARC. However, the cocos2d code itself does not use ARC and there are no templates provided by cocos2d that you can use to start programming with ARC. You are required to add a seperate static library target for the cocos2d files yourself.

As Ankit指出,Tiny Tim Games对分叉版本的cocos2d-iphone做了必要的修改。使其与ARC兼容。这些更改已集成到开发版本中,并应在cocos2d v2.x分支中提供。我自从撰写了一篇教程,以在cocos2d中启用ARC (2.0)项目

As Ankit pointed out, Tiny Tim Games made the necessary changes to a forked version of cocos2d-iphone to make it ARC compatible. These changes have been integrated into the development version and should be available in the cocos2d v2.x branch. I've since written a tutorial to enable ARC in a cocos2d (2.0) project.

据说cocos2d本身将在v2.1或v2.2中转换为内部使用ARC。

It was said that cocos2d itself will be converted to use ARC internally in v2.1 or v2.2.

重要的是要注意,没有计划在cocos2d v1.x分支中正式支持ARC,因为v1.x行应该保持向后兼容第一代设备和iOS 3 。X。但是通用的ARC兼容性已添加到v1.1中。

It's important to note that there are no plans to officially support ARC in the cocos2d v1.x branch because the v1.x line is supposed to remain backwards compatible with 1st generation devices and iOS 3.x. But general ARC compatibility has been added to v1.1.

Kobold2D完全支持ARC,并已在所有15个模板项目中启用 差不多两个月了。 Kobold2D使用最新的稳定版本的cocos2d-iphone 1.x和2.x.只需启动一个新的Kobold2D项目,你就可以使用cocos2d和ARC。

Kobold2D fully supports ARC and has it enabled in all 15 template projects for almost two months now. Kobold2D uses the latest stable versions of cocos2d-iphone 1.x and 2.x. Just start a new Kobold2D project and you're set to work with cocos2d and ARC.

这篇关于cocos2d是否支持ARC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆