NSString
我从中得到了UIWebView
包含 iPhone 表情符号和不包括表情符号的反转文本。我需要NSString
再次显示反转,UIWebView
但无法使用表情符号获得反转的字符串。我没有在字符串中识别表情符号字符。我有带有 iOS 6.0 的 xcode 4.5。这是我的代码:
- (NSString *) createReverseStringFromString:(NSString *)inputString {
if (inputString.length <= 0)
return inputString;
NSMutableString *mutableReverseString = [[NSMutableString alloc]
initWithCapacity:inputString.length];
Thfor (NSInteger i = inputString.length -1; i >= 0; i--) {
NSString *characterString = [inputString substringWithRange:NSMakeRange(i, 1)];
[mutableReverseString appendString:characterString];
NSLog(@"mutableReverseString..%@",mutableReverseString);
}
NSString *outputString = [mutableReverseString copy];
[mutableReverseString release];
return [outputString autorelease];
}