I haven't been able to figure out how to convert a NSString to an int. I'm trying to convert ASCII to text, but to do that I need to convert a string to an int.
I find it really strange that this isn't anywhere online or in stack overflow. I'm sure I'm not the online one who needs this.
Thanks in advance for helping.
P.S. If this helps here is the code I'm using to convert to ASCII:
+ (NSString *) decodeText:(NSString *)text {
NSArray * asciiCode = [text componentsSeparatedByString:@"|"];
int i = 0;
NSMutableString *decoded;
while (i < ([asciiCode count]-1) ) {
NSString *toCode = [asciiCode objectAtIndex:i];
int codeInt = toCode;
NSString *decode = [NSString stringWithFormat:@"%c", codeInt];
[decoded appendString:decode];
}
return decoded;
}