Is there an easy way to convert an Objective-C 2.0 file to Objective-C 1? I am writing a Cocoa app, and I decided to support Tiger, which doesn't support Obj. C 2.0. I know I should have thought of it before I wrote a whole bunch of code, but is there an easy way to convert it back? Thanks!
views:
67answers:
2
+1
A:
- If you are using Garbage Collection, you'll need to undo that.
- Remove all property usage (writing your own accessors where needed)
- If you are iterating through collections via
for(object in collection)
you'll need to redo.
MarkPowell
2009-12-13 16:56:52
Thanks! I'm not using GC, so that's taken care of. I use plenty of properties, though. Is there a script or tool that will let me convert it?
Adrian Sarli
2009-12-13 16:59:02
I would search through Xcode plugins. But I have a feeling this is not a popular request. I've seen somethings that create properties, but not any that remove them.
MarkPowell
2009-12-13 17:09:11
Write yourself a script, it's quite simple.
Georg
2009-12-13 17:15:04
+2
A:
Here's a Objective-C 1.0 foreach
macro that can make converting the for(id obj in collection)
loops a lot easier. Using it, you can say: foreach(id,obj,collection){…}
. I used it for a couple of years before fast enumeration, and it worked great.
Vincent Gable
2009-12-15 00:48:01