简体   繁体   中英

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 :

How should I fix the following issues ?

  • Use of (strong) in properties
  • Use of (nonatomic) in properties
  • Instance methods not found (not having being declared in the interface)
  • Enable new-style Objective-C

Also, it seems to be complaining about NSScrollerKnobStyle not being defined. Is it a 10.8-to-10.6 SDK-specific issue?


PS The control I'm using is ITSidebar

You're going to have to change those strong properties to retain or copy , as appropriate. There's nothing wrong with nonatomic in non-ARC code.

You may have to add @synthesize directives for your properties to get the compiler to add accessor methods. @synthesize is the default in the latest compiler.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM