1
I need to convert this small code in Java to Objective-C to run a function in Objective-C, but there is an error that I haven’t been able to find yet.
Java code:
final char CHR0 = 0;
String finalprotocolo = "" + CHR0 + "";
String ligartv = "/ARP/IR/enviar/LigaTV" + finalprotocolo;
byte[] arrayligartv = ligartv.getBytes();
Code Objective-C:
unichar c = 0x00;// c = 0x00;
NSString *nova = [NSString stringWithFormat:@"%c", c];
//NSString *nova = [NSString stringWithCharacters:&c length:1];
// Pega a menssagem<br>
NSString *final = @"/ARP/enviar/LigaTV";
NSString *mensagem = [final stringByAppendingString:nova];
I need to perform the same Java code function, just by transforming byte 0 into String and adding the Objective-C message variable.
What error is happening?
– Paulo Rodrigues
I use this code to perform determines function in Arduino and with Java code it works, but with Objective-C no. Would it have some peculiarity in the language in question or is it code error? @Paulorodrigues
– user75138