The way of doing it is to use characterAtIndex:
, but you don't need to cast it to a NSString
pointer, since NSMutableString
is a subclass of NSString
. So it isn't that long, but if you still don't find it comfortable, I suggest to use UTF8String
to obtain a C string over which you can iterate using the brackets operator:
const char* cString= [MyMutableStr UTF8String];
char first= cString[0];
But remember this (taken from NSString class reference):
The returned C string is automatically freed just as a returned object would be released; you should copy the C string if it needs to store it outside of the autorelease context in which the C string is created.