0
我有一個問題發送口述文本到另一個接口控制器。發送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]的話是{ 千字= 「(\ n你好\ n)的」; }
這裏是一個截屏,顯示我的問題:
的(
應該顯示單詞Hello
。我該如何解決這個問題?