From the apple reference documents:
http://developer.apple.com/document....html#//apple_ref/occ/instm/NSString/intValue
intValue is what you're looking for.
-Lee
unichar specialChar = [myStr characterAtIndex: 0];
specialChar = specialChar + 2;
NSLog(@"string: %@", [NSString stringWithCharacters: &specialChar length:1]);
typedef unsigned short unichar;
glad you got what you needed... it's no surprise since unichar is just:
Code:typedef unsigned short unichar;
Which means it's an unsigned 2-byte integer. However, you should be careful with addition on characters. Encodings can bite you here.
-Lee
Certainly nothing terrible will happen. As long as you "don't care" about the character generated (it may be unprintable, etc.), there's no real problem. You're not doing pointer math, so you won't get crashes based on bad pointers. If you overflow the unsigned short, it will just wrap around. Again, if you don't care what character you get, no big deal.
-Lee