iOS 中文转拼音
- (NSString *)pinYin
{
NSMutableString *pinyin = [self mutableCopy];
//转换成拼音
CFStringTransform((__bridge CFMutableStringRef)pinyin, NULL, kCFStringTransformMandarinLatin, NO);
//去掉音标
CFStringTransform((__bridge CFMutableStringRef)pinyin, NULL, kCFStringTransformStripDiacritics, NO);
return [pinyin stringByReplacingOccurrencesOfString:@" " withString:@""];
}