Is NSURLSession is not working on v0.4? I am tryin...
# kotlin-native
i
Is NSURLSession is not working on v0.4? I am trying with a delegate with two required methods have a println, it is not being displayed. I guess delegate isn't be called.
s
It works. Have you seen our spinner demo? https://github.com/JetBrains/kotlinconf-spinner/blob/master/kotlin-native/samples/fullstack/clients/ios/src/main/kotlin/platformUtils.kt#L43 Please note that because of Kotlin/Native object transfership policy,
NSURLSession
should be explicitly configured to run delegate on main queue: https://github.com/JetBrains/kotlinconf-spinner/blob/master/kotlin-native/samples/fullstack/clients/ios/src/main/kotlin/platformUtils.kt#L75
i
My code is a bit similar of that one without class.
s
Your app doesn’t seem to run any event loop. That’s why delegate of asynchronous request isn’t called. If you write the same program in Objective-C, it wouldn’t work either.