There are some good Java translators in Objective-C. For code that is simple, they should all work. Where translators tend to have a lot of problems, this is transferring calls to runtime libraries due to their diverging philosophies (especially in the area of โโappearance and user interaction). To do a good job here, they need to move from syntax to semantics, and this is very difficult for software.
Your phrase "static Java typing and convention by convention. While Objective-C is dynamically typed and convention by convention" cannot but refer to this. In particular, the development of a graphical interface. This aspect of languages โโis not an integral part for them, but it belongs to the libraries that developers usually use, in many cases depending on specific operating systems. Thus, we are probably not talking so much about converting Java to Objective-C, as about converting from Swing style and how it interacts in iOS.
All reviewed, I would recommend using automatic conversion tools as training tools. You will see that the generated code fragments (as they become more complex and / or include user interfaces), even if they work, are not suitable for maintenance or further development and require re-encoding if they are not processed. But then again, as training tools, they are very useful.
- Google J2ObjC
- java2objc
- JCGO This one is converted to C. If the goal is to work something, it can be good enough. Not if the goal is to learn Objective-C in all its splendor.
source share