I think I have run into this issue: <https://stack...
# kotlin-native
j
I think I have run into this issue: https://stackoverflow.com/questions/2567498/objective-c-categories-in-static-library/9224606 while trying to convert a iPhone staticLibrary to klib, where the objective-C code uses categories to extend dictionary methods. Is there currently any way to resolve this with kotlin native (without having to add extra linker options inside the xcode project later)? The issue I currently get when running my ios Target:
-[__NSDictionaryM bsg_ksc_safeSetObject:forKey:]: unrecognized selector sent to instance 0x281678f60
s
Try adding
-ObjC
to
linkerOpts
in your
.def
file.
j
Adding
linkerOpts("-ObjC")
to the target solves the issue for frameworks yes it seems
but the kotlin code is also getting exported as a staticLib
Would the same work for that?
(I have not tested, but it seems a bit weird in my head that it would work)
s
Then try adding this option to the final binary you link Kotlin code to.
j
Will test
That sadfully does not seem to work
Copy code
staticLib {
      linkerOpts("-ObjC")
}
that is
So the only option is to add
-ObjC
to the final xcode project then?
s
Yes.
j
Allright, thanks for the assistance