Saturday, 7 September 2013

componentsSeperatedByString returns full word

componentsSeperatedByString returns full word

I am trying to get each letter of an NSString using this line of code:
NSArray *array = [string componentsSeparatedByString:@""];
//string is equal to Jake
NSLog(@"Array Count:%d",[array count]);
I am expecting to get each letter of the word "Jake" but instead I am
getting the whole word. Why?

No comments:

Post a Comment