Oscar Castillo
Registered
lets says you have a string you want to print each character on a seperate line, since NSString is an array of Unicode characters I thought along these lines
int x;
NSString *str=@"an ordinary string";
for (x = 0; x < [str length]; x++)
{
NSlog(@"%d",[str characterAtIndex:x]);
}
Problem is chracterAtIndex: returns a (unichar), but I want the actual character. I thought about readin the values into an array, but thought there might be an easier way.
int x;
NSString *str=@"an ordinary string";
for (x = 0; x < [str length]; x++)
{
NSlog(@"%d",[str characterAtIndex:x]);
}
Problem is chracterAtIndex: returns a (unichar), but I want the actual character. I thought about readin the values into an array, but thought there might be an easier way.