Objective C NSString problem
I have a NSString that I need to examine character by character and: examine char perform calculation loop (until string ends) Any thoughts on the best way to do this? Do I need to convert the NSString to a NSArray or C string? The simplest way to go about it is using NSString 's characterAtIndex: method: int charIndex; for (charIndex = 0; charIndex < [myString length]; charIndex++) { unichar testChar = [myString characterAtIndex:charIndex]; //... your code here } -characterAtIndex: is the simplest approach, but the best is to drop down to CFString and use a CFStringInlineBuffer, as in this