別のインターフェイスコントローラに指示されたテキストを送信する際に問題が発生しています。ここでWatchKit音声認識のテキストを別のインターフェイスコントローラに送信
は私のコードです:
- (IBAction)voiceRecognition {
[self presentTextInputControllerWithSuggestions:nil allowedInputMode:WKTextInputModePlain completion:^(NSArray *results) {
NSLog(@"results: %@", results);
NSString *wordKey = [NSString stringWithFormat:@"%@",results];
NSDictionary *dict = @{@"kWord":wordKey};
[self pushControllerWithName:@"Dictionary" context:dict];
}];
}
ログ:
ウォッチ拡張[3185:2835671]結果:(こんにちは)
他のインターフェース・コントローラからデータを取得:
- (void)awakeWithContext:(id)context {
[super awakeWithContext:context];
NSDictionary *dict = (NSDictionary *)context;
[_word setText:dict[@"kWord"]];
NSLog(@"The Word is %@",[dict description]);
}
の
ログ:
時計拡張【3185:2835671] Wordは{ Kワード= "(\ nはハローの\ n)" です。ここで }
は私の問題を示しているスクリーンショットです:
(
ワードHello
を表示するようになっています。この問題を解決するにはどうすればよいですか?