0

I am testing an app on an iPad with iOS9 and whenever navigating a ViewController that contains a WKWebView it throws an error.

Thread 1: EXC_BAD_ACCESS (code=1, address=0x321)

This is not an issue with iOS13.

The code used to present the viewcontorller is as follows. It works for all view controllers in iOS13 but fails in iOS9

viewControllerMenu *viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"mainMenu"];
viewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
viewController.modalPresentationStyle = UIModalPresentationCustom;
[self presentViewController: viewController animated:YES completion:nil]; ** Fails on this line **

If I change the storyboard ID to a view controller that does not have a WKWebView it is fine.

Any ideas?

RGriffiths
  • 5,722
  • 18
  • 72
  • 120
  • WKWebView is available iOS 8.0 onwards, so iOS Version is not the issue. There might be some other issue, use exception breakpoints for debugging or post the code here. – udbhateja May 03 '20 at 12:34
  • Thanks and I thought that it should be fine from iOS8 onwards. I have edited the post a little. There is no further debugging information that I get as far as I can see. Nothing in the debugger and can't if I put a break on it all I get is the error when I step through the line. – RGriffiths May 03 '20 at 12:53
  • `viewController.modalPresentationStyle = UIModalPresentationCustom;` Comment this line and try. – udbhateja May 03 '20 at 14:03
  • Yes I have tried that but still no joy. I think it is known issue https://stackoverflow.com/questions/46221577/xcode-9-gm-wkwebview-nscoding-support-was-broken-in-previous-versions. Will try programmatically. – RGriffiths May 04 '20 at 08:45

0 Answers0