2016-07-22 9 views

答えて

2

文字列内の単一の文字がある場合にのみ、文字列のな長さは、それが小文字の文字列に変換するよりも1である場合は、チェックのこの回避策を使用することができ、

NSString *stringToUtter = @"A"; 
if (stringToUtter.length==1) { 
    stringToUtter = [stringToUtter lowercaseString]; 
} 
AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:stringToUtter]; 
utterance.rate = AVSpeechUtteranceMinimumSpeechRate; 
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-us"]; 
[self.synthesizer speakUtterance:utterance]; 
+0

感謝you.itsを

起こります私のために働く –

関連する問題