objective c - Anexar unichar a NSMutableString
objective-c nsstring (1)
¿Cómo se unichar
un carácter NSMutableString
a NSMutableString
?
unichar c = ''T'';
NSMutableString *s = [NSMutableString stringWithString:@"MyString"];
// want s to become "MyStringT"
https://discussions.apple.com/thread/1679290 sugiere:
[s appendString:[NSString stringWithCharacters:&c length:1]];
Parece demasiado largo / complicado ...
Utilice [NSString appendFormat:], para arriba:
[s appendFormat:@"%C", c];
¡Disfrutar!