//获取字符串的拼音
- (NSString *)phonetic
{
NSString *str = [self stringByReplacingOccurrencesOfString:@"-" withString:@" "];
NSMutableString *source = [str mutableCopy];
CFStringTransform((__bridge CFMutableStringRef)source, NULL, kCFStringTransformMandarinLatin, NO);
CFStringTransform((__bridge CFMutableStringRef)source, NULL, kCFStringTransformStripDiacritics, NO);
return source;
}
时间: 2024-10-13 02:36:03