NativeScript / ios-jsc

NativeScript for iOS using JavaScriptCore

Home Page:http://docs.nativescript.org/runtimes/ios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VSCode debugger crashes on old simulators

DimitarTachev opened this issue · comments

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.2.0
  • Cross-platform modules: 5.2.0
  • iOS Runtime: 5.2.0

Describe the bug

To Reproduce

  1. tns create jsApp --js && cd jsApp && code .
  2. Replace your onTap method with the one below:
viewModel.onTap = (args) => {
    const btn = args.object;
    const native = btn.nativeView;
    console.log(native);
};
  1. Set a breakpoint inside the above-mentioned method.
  2. Start an old simulator (<11.0) e.g. with iPhone 6 with iOS 9.3.
  3. Click Launch on iOS from VSCode.
  4. Try to inspect the nativeView of the button.
  5. You will get [UIButton adjustsImageSizeForAccessibilityContentSizeCategory]: unrecognized selector sent to instance exception and the app will crash (this property is introduced in iOS 11).

Expected behavior
The iOS runtime should not return properties for newer iOS version through the debug protocol. In this case the returned properties should be for iOS <=9.3.

The bug is caused by adjustsImageSizeForAccessibilityContentSizeCategory being declared without availability attributes while at the same time its defining protocol UIAccessibilityContentSizeCategoryImageAdjusting is declared available since iOS 11.0