I’ve got an `expect` class called Date: ```expect ...
# kotlin-native
y
I’ve got an
expect
class called Date:
Copy code
expect class Date() {

    companion object {
        val current: Double
    }
}
This is the ios actual:
Copy code
package com.careem.adma.booking.framework.Date

import platform.Foundation.*

actual class Date actual constructor () {
    actual companion object {
        actual val current: Double = NSDate.timeIntervalSince1970()
    }
}
but i’m getting this error:
Copy code
error: unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
@ObjCMethod public external fun NSDate.timeIntervalSince1970(): NSTimeInterval /* = Double */ defined in platform.Foundation
        actual val current: Double = NSDate.timeIntervalSince1970()
s
NSDate.timeIntervalSince1970
seems to be instance method.
So please try something like
NSData().timeIntervalSince1970()
.
y
Thanks!
but if i do that, i get an exception:
Undefined symbols for architecture arm64:
and it prints a very long stack trace
I’ve got a sample project where you can observe the error
s
Could you please post the stack trace here?
And complete error message too.
y
I will have to DM you as the message is too long
s
Your project is apparently configured to use Kotlin/Native 0.6. Have you tried more recent releases, i.e. 0.6.2 or 0.6.1? We have definitely fixed some of the bugs similar to this one.
y
Ah yes it worked when using 0.6.2!
thankyou!
Also, is it possible to get autocomplete or compiler errors for the iOS platform module? I’m using Android Studio at the moment
Will AppCode start supporting kotlin/native as well?
o
Yes, AppCode support is very actively worked on