I am getting some weird numbers returned from the characterAtIndex method for Object-C in the iPhone SDK. The code snippet is as follows:
NSString *new_text;
new_text = [new_text stringByAppendingFormat:@"%@",UITextView_1.text];//=a,b,...f
for(int i = 0; i <= 6; i++)
{
char_num = [new_text characterAtIndex:i];
}
I am trying to get the decimal number for the individual character. I am either getting the wrong value each time. Sometimes the value is greater than 8,000! I should be getting back the number 65 through 71.