Ich habe ein Problem beim Senden von diktiertem Text an einen anderen Schnittstellencontroller.Den Text der WatchKit-Spracherkennung an einen anderen Schnittstellencontroller senden
Hier ist mein Code:
- (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];
}];
}
Logs:
Uhr Verstellbereich [3185: 2.835.671] Ergebnisse: (Hallo)
Erste Daten aus anderen Schnittstellen-Controller:
- (void)awakeWithContext:(id)context {
[super awakeWithContext:context];
NSDictionary *dict = (NSDictionary *)context;
[_word setText:dict[@"kWord"]];
NSLog(@"The Word is %@",[dict description]);
}
Logs:
beobachten Verstellbereich [3185: 2.835.671] Das Wort ist { kWord = "(\ n Hallo \ n)"; }
Hier ist ein Screenshot, der mein Problem zeigt:
Die (
soll Hello
das Wort zeigen. Wie kann ich dieses Problem beheben?