I am having difficulty with subj.
I have NSString text, contains “SLOVO”, and i need that NSMutableString* currentRequest contain “%t%e%x%t%”.
I trying in cycle:
[currentRequest appendFormat:@"%c%%", [text characterAtIndex:i]];
It’s working fine, BUT if text contain for example “Rüdiger”, i mean non latin symbols, then currentRequest contains full trash !
I’ve see decide is use
(void)insertString:(NSString *)aString atIndex:(NSUInteger)anIndex
but i think it is no right way.
May be know right way ?
thanks.
I may have misunderstood, but I think the issue with
appendFormatis a mismatch between the%cformat specifier and the return type of thecharacterAtIndexmethod.Method
characterAtIndexreturns aunichar, whereas%cexpects an 8-bitunsigned char. Use%C(uppercase C) instead in your format string.Some Apple developer docs for reference: