There is a description in Objective-C interop:
Note that the opposite reversed translation is not implemented yet: Swift/Objective-C error-throwing methods aren't imported to Kotlin as exception-throwing.
So, I want to know how can I catch the error from the Objective-C function? For example.
How can I catch
Note that the opposite reversed translation is not implemented yet: Swift/Objective-C error-throwing methods aren't imported to Kotlin as exception-throwing.
Gijs van Veen
03/06/2023, 8:42 AM
So in the case of divide by zero, just check your divisor isnt zero before calling and throw your own exception
r
Ran
03/07/2023, 9:40 AM
OK, but this still is a flaw of kotlin multiplatform. We cannot check the errors in advance because some errors occurred in the platform-specific functions.
Anyway, thanks to your response.