當用戶輸入通過在UITextView中的語音文本,應用程序崩潰的UITextView時通過語音用戶輸入
崩潰方法
讓TextView的第一個響應者通過點擊它,然後按在麥克風按鈕的應用程序崩潰鍵盤則言語的東西,然後在完成應用程序崩潰..
沒什麼特別與UITextView的做我的情況..
控制檯輸出
*
終止應用程序由於未捕獲的異常 'NSInvalidArgumentException' 的,原因是: '嘗試改變一個不可改變 對象與deleteCharactersInRange:'
-
第一次扔卡升堆棧:(0x19443c1c0 0x192e7455c 0x19443c108 0x1943d9b18 0x19a58d138 0x194e1a3c4 0x1943fd958 0x1943fb9e4 0x194e1a218 0x19aa9aac8 0x19aa9b270 0x19aa9a0b4 0x19aa97680 0x19aa979f0 0x19aa9afd0 0x19aa9b50c 0x19cdbf800 0x19cdbf064 0x19cdbf74c 0x19cdc4354 0x1005e925c 0x1005e921c 0x1005ee284 0x1943e9f2c 0x1943e7b18 0x194316048 0x195d99198 0x19a2e9628 0x19a2e4360 0x1001e03c4 0x1932f85b8)的libC++ abi.dylib:端接上進一步調試我得到(通過輸入BT在控制檯)類型NSException
的 未捕獲的異常它給我
* thread #1: tid = 0x645a4, 0x000000019340a014 libsystem_kernel.dylib`__pthread_kill + 8, queue =
'com.apple.main線程',停止原因=信號SIGABRT 幀#0:0x000000019340a014 libsystem_kernel.dylib
__pthread_kill + 8 frame #1: 0x00000001934d1460 libsystem_pthread.dylib
pthread_kill + 112 幀#2:0x000000019337e3f4 libsystem_c.dylibabort + 140 frame #3: 0x0000000192e492d4 libc++abi.dylib
abort_message + 132 幀#4:0x0000000192e66cc0的libC++ abi.dylibdefault_terminate_handler() + 304 frame #5: 0x0000000192e74844 libobjc.A.dylib
_objc_terminate()+ 124 幀#6:0x0000000192e6366c的libC++ abi.dylibstd::__terminate(void (*)()) + 16 frame #7: 0x0000000192e62f84 libc++abi.dylib
__cxa_throw + 136 幀#8:0x0000000192e74690 libobjc.A。dylibobjc_exception_throw + 364 frame #9: 0x000000019443c108 CoreFoundation
+ [NSException提高:格式:] + 116 幀#10:0x00000001943d9b18的CoreFoundationmutateError + 132 frame #11: 0x000000019a58d138 UIKit
- [UIScrollView中描述] + 104 幀#12:0x0000000194e1a3c4基金會_NSDescriptionWithLocaleFunc + 108 frame #13: 0x00000001943fd958 CoreFoundation
__CFStringAppendFormatCore + 7996 幀#14:0x00000001943fb9e4的CoreFoundation_CFStringCreateWithFormatAndArgumentsAux2 + 244 frame #15: 0x0000000194e1a218 Foundation
+ [NSString的stringWithFormat :] + 68 幀#16:0x000000019aa9aac8的UIKit-[UIDictationController insertSerializedDictationResult:withCorrectionIdentifier:] + 144 frame #17: 0x000000019aa9b270 UIKit
__98- [UIDictationController finishDictationRecognitionWithPhrases:語言模型:correctionIdentifier:] _ block_invoke + 464 幀#18:0x000000019aa9a0b4的UIKit-[UIDictationController performIgnoringDocumentChanges:] + 48 frame #19: 0x000000019aa97680 UIKit
- [UIDictationController _runFinalizeOperation:] + 56 幀#20:0x000000019aa979f0 UIK它-[UIDictationController setState:] + 612 frame #21: 0x000000019aa9afd0 UIKit
- [UIDictationController finishDictationRecognitionWithPhrases:語言模型:correctionIdentifier:] + 552 幀#22:0x000000019aa9b50c的UIKit-[UIDictationController dictationConnection:didRecognizePhrases:languageModel:correctionIdentifier:] + 204 frame #23: 0x000000019cdbf800 AssistantServices
__105- [AFDictationConnection _tellSpeechDelegateDidRecognizeSpeechPhrases:語言模型:correctionIdentifier:] _ block_invoke + 80 幀#24:0x000000019cdbf064 AssistantServices-[AFDictationConnection _dispatchCallbackGroupBlock:] + 240 frame #25: 0x000000019cdbf74c AssistantServices
- [AFDictationConnection _tellSpeechDelegateDidRecognizeSpeechPhrases:語言模型:correctionIdentifier:] + 356 幀#26:0x000000019cdc4354 AssistantServices__101-[AFDictationConnectionServiceDelegate speechDidRecognizePhrases:usingSpeechModel:correctionContext:]_block_invoke + 76 frame #27: 0x00000001005e925c libdispatch.dylib
_dispatch_call_block_and_release + 24 幀#28:0x00000001005e921c libdispatch.dylib_dispatch_client_callout + 16 frame #29: 0x00000001005ee284 libdispatch.dylib
_dispatch_main_queue_callback_4CF + 1200 幀#30:0x00000001943e9f2c的CoreFoundation__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 frame #31: 0x00000001943e7b18 CoreFoundation
__CFRunLoopRun + 1660 幀#32:0x0000000194316048的CoreFoundationCFRunLoopRunSpecific + 444 frame #33: 0x0000000195d99198 GraphicsServices
GSEventRunModal + 180 幀#34:0x000000019a2e9628的UIKit-[UIApplication _run] + 684 frame #35: 0x000000019a2e4360 UIKit
UIApplicationMain + 208 *幀#36:0x00000001001e03c4格言移動main(argc=1, argv=0x000000016fdd3ab8) + 124 at main.m:16 frame #37: 0x00000001932f85b8 libdyld.dylib
開始+ 4
代碼使用
@property(strong,nonatomic) UITextView *addressTextView;
- (void)viewDidLoad {
[super viewDidLoad];
addressTextView.delegate = self;
addressTextView.text = [self.dictionaryEditObject objectForKey:@"location"];
}
-(void)textViewDidBeginEditing:(UITextView *)textView
{
}
- (BOOL)textViewShouldBeginEditing:(UITextView *)textView
{
NSLog(@"textViewShouldBeginEditing:");
return YES;
}
-(void)textViewDidEndEditing:(UITextView *)textView
{
NSLog(@"textViewDidEndEditing");
}
試穿 iOS版:10.2,9.3 設備:每個設備
任何幫助,將不勝感激 感謝
請添加一些代碼,否則不清楚如何指出您的問題。 –
但在那裏我看不到任何代碼在這裏... –
是位置值stirng?一旦格式化和檢查 – karthikeyan