Has anyone ever gotten an "Initializer is not implemented" error when trying to subclass an Obj-C class?
a
Artyom Degtyarev [JB]
06/17/2020, 6:43 AM
Hello! Have you looked through this paragraph? Maybe the
@OverrideInit
annotation would help here.
d
Derek Ellis
06/17/2020, 9:15 PM
I think the issue is that the initializer that isn't implemented isn't one inherited from the direct super class, instead it's from the super class of the super class:
Copy code
ObjCSuper (initWithSomething)
^
|
ObjC (does not override initWithSomething)
^
|
Kotlin (initWithSomething not implemented!)
@OverrideInit
does work, but since the missing initializer deals with other native C++ code from an external library, it's not ideal to have to re-implement it in the Kotlin subclass. Is there any way around this?