is this the right way to declare the hidden method...
# ios
s
is this the right way to declare the hidden method? @kotlinx.cinterop.ObjCMethod(“”, “”) external fun NSURLRequest.Companion.setAllowsAnyHTTPSCertificate(allow: Boolean, host: NSString):kotlin.Unit
s
Please don’t use
@ObjCMethod
and/or
external
, it is not intended to be used in source code. If I understand you correctly, adding
cinterop
configuration with
.def
file containing Objective-C category declaration should help.
s
How to make cinterop convert objc code? Is there a sample project?
s
Please refer to the documentation, for example: https://kotlinlang.org/docs/tutorials/native/curl.html Use something like
Copy code
language = Objective-C
---
@interface MyClass (MyCategory)
// ...
@end;
as
.def
file. In this case you don’t need `headers`/`linkerOpts`/whatever.
s
Thanks, @svyatoslav.scherbina got it to compile