The application crashes when a user enters text through a voice in a UITextView,
Crash method
make the first textview responder by clicking on it, then press the microphone button on the keyboard, then say something, and then click “Stop Application”.
In my case, nothing is done with uitextview.
Console exit
*
Application termination due to the uncaught exception "NSInvalidArgumentException", reason: "Attempting to change immutable object with deleteCharactersInRange: '
The first roll call stack: (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) libS ++ abi.dylib: completion via an uncaught exception of type NSException
upon further debugging that I received (by entering bt in the console), it gives me
* thread
'com.apple.main-thread', stop reason = SIGABRT frame # 0: 0x000000019340a014 libsystem_kernel.dylib __pthread_kill + 8
frame #1: 0x00000001934d1460 libsystem_pthread.dylib pthread_kill + 112 frame # 2: 0x000000019337e3f4 libsystem_c.dylib abort + 140
frame #3: 0x0000000192e492d4 libc++abi.dylib abort_message + 132 frame # 4: 0x0000000192e66cc0 lib++ abi.dylib default_terminate_handler() + 304
frame #5: 0x0000000192e74844 libobjc.A.dylib _objc_terminate() + 124 frame # 6: 0x0000000192e6366c lib++ abi.dylib std::__terminate(void (*)()) + 16
frame #7: 0x0000000192e62f84 libc++abi.dylib __ cxa_throw + 136 frame # 8: 0x0000000192e74690 libobjc.A.dylib objc_exception_throw + 364
frame #9: 0x000000019443c108 CoreFoundation + [NSException raise: format:] + 116 frame # 10: 0x00000001943d9b18 CoreFoundation mutateError + 132
frame #11: 0x000000019a58d138 UIKit - [UIScrollView description] + 104 frame # 12: 0x0000000194e1a3c4 Foundation _NSDescriptionWithLocaleFunc + 108
frame #13: 0x00000001943fd958 CoreFoundation __ CFStringAppendFormatCore + 7996 frame # 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: languageModel: correctionIdentifier:] _ block_invoke + 464 frame # 18: 0x000000019aa9a0b4 UIKit -[UIDictationController performIgnoringDocumentChanges:] + 48
frame #19: 0x000000019aa97680 UIKit - [UIDictationController _runFinalizeOperation:] + 56 frame # 20: 0x000000019aa979f0 UIKit -[UIDictationController setState:] + 612
frame #21: 0x000000019aa9afd0 UIKit - [UIDictationController finishDictationRecognitionWithPhrases: languageModel: correctionIdentifier:] + 552 # 22: 0x000000019aa9b50c UIKit -[UIDictationController dictationConnection:didRecognizePhrases:languageModel:correctionIdentifier:]
+ 204
frame #23: 0x000000019cdbf800 AssistantServices __ 105- [AFDictationConnection _tellSpeechDelegateDidRecognizeSpeechPhrases: languageModel: correctionIdentifier:] _ block_invoke + 80 frame # 24: 0x000000019cdbf064 AssistantServices -[AFDictationConnection
_dispatchCallbackGroupBlock:] + 240
frame #25: 0x000000019cdbf74c AssistantServices - [AFDictationConnection _tellSpeechDelegateDidRecognizeSpeechPhrases: languageModel: correctionIdentifier:] + 356 frame # 26: 0x000000019cdc4354 AssistantServices __101-[AFDictationConnectionServiceDelegate
speechDidRecognizePhrases:usingSpeechModel:correctionContext:]_block_invoke
+ 76
frame #27: 0x00000001005e925c libdispatch.dylib _dispatch_call_block_and_release + 24 frame # 28: 0x00000001005e921c libdispatch.dylib _dispatch_client_callout + 16
frame #29: 0x00000001005ee284 libdispatch.dylib _dispatch_main_queue_callback_4CF + 1200 frame # 30: 0x00000001943e9f2c CoreFoundation __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
frame #31: 0x00000001943e7b18 CoreFoundation __ CFRunLoopRun + 1660 # 32: 0x0000000194316048 CoreFoundation CFRunLoopRunSpecific + 444
frame #33: 0x0000000195d99198 GraphicsServices GSEventRunModal + 180 # 34: 0x000000019a2e9628 UIKit -[UIApplication _run] + 684
frame #35: 0x000000019a2e4360 UIKit UIApplicationMain + 208 * frame # 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
: iPad, iPod, iPhone 5s