Convert java to target C

I'm trying to convert java code to objective - C. The following course is Extension of

package com.TestCode.api;

import java.io.IOException;

import oauth.signpost.exception.OAuthCommunicationException;
import oauth.signpost.exception.OAuthExpectationFailedException;
import oauth.signpost.exception.OAuthMessageSignerException;

import org.json.JSONObject;

public class Categories extends TestCodeRequest {

    public Categories(String apiKey,String apiSecret) {
            super(apiKey,apiSecret,"categories");
    }

    public Categories field(Object... fields) {
        super.field(fields);
        return this;
    }

    public JSONObject getCategories() throws OAuthMessageSignerException,OAuthExpectationFailedException,OAuthCommunicationException,IOException {
        return this.get();
    }

    public Categories categoriesField(Object... fields) {
        return this.field(fields);
    }

}

Solution

There are several good java to objective C translators For simple code, all code should be valid Translators often encounter a lot of trouble in converting calls to runtime libraries because of their different ideas (especially in appearance and user interaction) To do well here, they need to go back from syntax to semantics, which is very difficult for software

Your phrase "Java is statically typed, and the configuration exceeds the Convention. While Objective-C is dynamically typed, and the Convention is better than the configuration" can't help but refer to this Especially GUI development This aspect of languages is not inherent in them, but belongs to the library commonly used by developers, which in many cases depends on a specific operating system Therefore, we may not convert java to objective C, but convert it from swing appearance and interaction mode to IOS

With this in mind, I suggest you use the automatic conversion tool as a learning tool You will see that the generated code fragments (because they become more complex and / or contain user interfaces) are not suitable for maintenance or further development even if they work, and need to be re coded if they are not redesigned But again, they are very useful as learning tools

>Google j2objc > java2objc > jcgo this is converted to C. if the purpose is to make something effective, this may be enough If the goal is to learn all the highlights of goal C, it is not

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>