Posts

Post not yet marked as solved
0 Replies
831 Views
I have a web based application that needs to check the current textInputMode. In earlier iOS versions code was working properly, but the same code has start crashing in iOS 11.3 . The app crashes if list of keyboards added in Settings does not conatin "en-US" or "en-GB".//observer added on keyboard actions[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(inputModeDidChange:) name:UITextInputCurrentInputModeDidChangeNotification object:nil];//Below method implemented to check current text input mode-(void)inputModeDidChange:(NSNotification *)notification { NSString *inputMethod = [[UITextInputMode currentInputMode] primaryLanguage]; //NSString *inputMethod = [UIApplication sharedApplication].delegate.window.textInputMode.primaryLanguage; NSLog(@"inputMethod=%@",inputMethod); if (!([inputMethod isEqualToString:@"en-GB"] || [inputMethod isEqualToString:@"en-US"])) { UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Warning" message:@"Application supports English (US) and English (UK) keyboard only." delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil]; [alert show]; }}I am aware that currentInputMode is deprecated since iOS 7.0 : [[UITextInputMode currentInputMode] primaryLanguage];So tried with -> NSString *inputMethod = [UIApplication sharedApplication].delegate.window.textInputMode.primaryLanguage;But it didn't work.The error message is as below : *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSDictionaryM setObject:forKey:]: object cannot be nil (key: UIAutofillContextDelegateKey)'But there is no explicit call to set value for UIAutofillContextDelegateKey anywhere in codeCan somebody help me?
Posted
by YogeshD.
Last updated
.
Post marked as solved
4 Replies
3.5k Views
I am trying to send message to native(written in swift) and in response of that, calling a javascript function for further process from native using WKWebView. The javascript is written maintaining callbacks so that further process continues. But after 2 callbacks application crashes. Its not giving any clear description of crash.While debugging, the logs show message : " warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available." and execution continues.After 2 callbacks between javascript and native it crashes saying BAD_ACCESS"Thread 1: EXC_BAD_ACCESS (code=2, address=0x13dd83d50)"xcode 9.2iOS 11.2.1
Posted
by YogeshD.
Last updated
.