jeudi 5 mars 2015

convert Android code to Objective-C IPhone code

Can any Developer please change this android code to Objective-C

I need this in the Objective-C format after it is done comment that


Any help will be appreciated


import java.util.HashMap;



public class RequestHeaders {
// TODO : Change class to enum pattern base
private String userToken,emailId;
private static RequestHeaders instance;

private static final String USER_EMAIL = "X-User-Email";
private static final String USER_TOKEN = "X-User-Token";
public static final String CONTENT_TYPE = "Accept";
public static final String CONTENT_TYPE_JSON = "application/json";

private RequestHeaders() {
}

public static RequestHeaders getInstance() {
if(instance == null){
instance = new RequestHeaders();
}
return instance;
}

public void setUserHeader(String userToken,String emailId){
this.userToken = userToken;
this.emailId = emailId;
}

public HashMap<String,String> getUserHeaderMap(){
HashMap<String,String> map = new HashMap<String,String>();
map.put(CONTENT_TYPE,CONTENT_TYPE_JSON);
map.put(USER_EMAIL,"atishay@msample.com");
map.put(USER_TOKEN,"LzBLYhq6VZx1yZRDKgCC");
return map;
}

public HashMap<String,String> getContentHeaderMap(){
HashMap<String,String> map = new HashMap<String,String>();
map.put(CONTENT_TYPE,CONTENT_TYPE_JSON);
return map;
}

}



Aucun commentaire:

Enregistrer un commentaire