Converting Java code block to Objective-C
Posted
by
user1123688
on Stack Overflow
See other posts from Stack Overflow
or by user1123688
Published on 2012-12-09T04:55:13Z
Indexed on
2012/12/09
5:04 UTC
Read the original article
Hit count: 98
I am trying to convert my Android app to iOS. This will be my first iOS app. I can't seem to translate this code properly. If someone wouldn't mind showing me how its done, that would be greatly appreciated.
//scrambBase20 is a Byte array
String descramble(String input){
char[] ret;
ret = input.toCharArray();
int offset = -scrambBase20.length;
for(int i=0;i<input.length();i++){
if(i%scrambBase20.length==0)
offset+=scrambBase20.length;
ret[scrambBase20[i%scrambBase20.length]+offset]=(char) ((byte) (input.charAt(i))^0x45);
}
String realRet = "";
for (char x : ret){
realRet+=x;
}
realRet = realRet.trim();
return realRet;
}
© Stack Overflow or respective owner