How can I parse XML in KN? 1. Can I use `org.jetb...
# kotlin-native
a
How can I parse XML in KN? 1. Can I use
org.jetbrains.kotlinx:kotlinx-serialization
? 2. I’ve found example for OSX but can’t understand how convert it to kotlin: https://stackoverflow.com/questions/21791702/nsxmlparser-simple-example 3. And how can I override this methods:
Copy code
@kotlinx.cinterop.ExternalObjCClass public interface NSXMLParserDelegateProtocol : platform.darwin.NSObjectProtocol {
    @kotlinx.cinterop.ObjCMethod public open fun parser(parser: platform.Foundation.NSXMLParser, didEndMappingPrefix: kotlin.String): kotlin.Unit { /* compiled code */ }

    @kotlinx.cinterop.ObjCMethod public open fun parser(parser: platform.Foundation.NSXMLParser, foundCharacters: kotlin.String): kotlin.Unit { /* compiled code */ }
...
s
And how can I override this methods
Generally using
override fun
in Kotlin should be enough.
a
Generally yes. But NSXMLParserDelegateProtocol has some functions with the same signature
s
Now I get. See the documentation: https://kotlinlang.org/docs/reference/native/objc_interop.html#subclassing-swiftobjective-c-classes-and-protocols-from-kotlin
To override different methods with clashing Kotlin signatures, you can add a 
@Suppress("CONFLICTING_OVERLOADS")
 annotation to the class.
👍 1