{N} app crashes when inspecting SearchBar with VSCode debugger
DimitarTachev opened this issue · comments
Dimitar Tachev commented
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
To Reproduce
tns create jsApp --js && cd jsApp && code .
- Replace the
<Button
with a<SearchBar
. - Replace your
onTap
method with the one below:
viewModel.onTap = (args) => {
const sb = args.object;
const native = sb.nativeView;
console.log(native);
};
- Set a breakpoint inside the above-mentioned method.
- Start a simulator e.g. iPhone X with iOS 12.1.
- Click
Launch on iOS
from VSCode. - Try to inspect the
nativeView
of the SearchBar. - The VSCode debugging will crash and the app will freeze.
Martin Bektchiev commented
The reason for the issue is that optional unimplemented methods were returned as supported by the JS wrapper object.
It lead to crashes only on Simulator because of #1044, on real devices it only logs errors when the VS Code debugger tries to read their values:
-[UISearchBarImpl collisionBoundingPath]: unrecognized selector sent to instance 0x106142820
-[UISearchBarImpl collisionBoundsType]: unrecognized selector sent to instance 0x106142820
-[UISearchBarImpl coordinateSpace]: unrecognized selector sent to instance 0x106142820