标签:
http://nshint.io/blog/2015/07/16/uicollectionviews-now-have-easy-reordering/
NSMutableString *str = [self mutableCopy];
CFStringTransform((CFMutableStringRef)str,NULL, kCFStringTransformMandarinLatin,NO);
//再转换为不带声调的拼音
CFStringTransform((CFMutableStringRef)str,NULL, kCFStringTransformStripDiacritics,NO);
return str;
NSString *hanziText = @"我是中国人";
if ([hanziText length]) {
NSMutableString *ms = [[NSMutableString alloc] initWithString:hanziText];
if (CFStringTransform((__bridge CFMutableStringRef)ms, 0, kCFStringTransformMandarinLatin, NO)) {
NSLog(@"pinyin: %@", ms);
}
if (CFStringTransform((__bridge CFMutableStringRef)ms, 0, kCFStringTransformStripDiacritics, NO)) {
NSLog(@"pinyin: %@", ms);
}
}
标签:
原文地址:http://www.cnblogs.com/studyNT/p/4838814.html