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
tns create jsApp --js && cd jsApp && code .
- Replace your
onTap
method with the one below:
viewModel.onTap = (args) => {
const btn = args.object;
const native = btn.nativeView;
console.log(native);
};
- Set a breakpoint inside the above-mentioned method.
- Start an old simulator (<11.0) e.g. with iPhone 6 with iOS 9.3.
- Click
Launch on iOS
from VSCode. - Try to inspect the
nativeView
of the button. - 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