[英]Convert ARC code to non-ARC
I'm struggling to get an existing ARC-enabled control to run under Xcode 4.2 (OSX Snow Leopard), in a non-ARC-enabled project, and I'm facing various issues : 我正在努力使现有的支持ARC的控件在不支持ARC的项目中在Xcode 4.2(OSX Snow Leopard)下运行,并且面临各种问题:
How should I fix the following issues ? 我应该如何解决以下问题?
(strong)
in properties (strong)
(nonatomic)
in properties (nonatomic)
Also, it seems to be complaining about NSScrollerKnobStyle
not being defined. 另外,似乎在抱怨
NSScrollerKnobStyle
。 Is it a 10.8-to-10.6 SDK-specific issue? 它是特定于10.8到10.6 SDK的问题吗?
You're going to have to change those strong
properties to retain
or copy
, as appropriate. 您将不得不适当地更改那些
strong
属性以retain
或copy
。 There's nothing wrong with nonatomic
in non-ARC code. 非ARC代码中的非
nonatomic
没有错。
You may have to add @synthesize
directives for your properties to get the compiler to add accessor methods. 您可能必须为属性添加
@synthesize
指令,以使编译器添加访问器方法。 @synthesize
is the default in the latest compiler. @synthesize
是最新编译器中的默认值。
There ae a number of other changes to the language, such as object literals. 语言还有许多其他更改,例如对象文字。 They're all well documented;
他们都有据可查; you just need to apply them in reverse.
您只需要反向应用它们即可。
I'm not sure about NSScrollerKnobStyle
, but if you look it up the documentation will tell you when it was introduced. 我不确定
NSScrollerKnobStyle
,但是如果您查找它,文档将告诉您何时引入。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.