我有一个KMM应用程序.在swftUI中,我从Kotlin存储库调用登录方法:
repo.login(email: $userId.wrappedValue, password: $password.wrappedValue) { user, error in
}
我有两种方法可以完全相同地登录到我的领域存储库.
suspend fun login(email: String, password: String): User {
return appService.login(Credentials.emailPassword(email, password))
}
suspend fun dologin(email: String, password: String): User {
return appService.login(Credentials.emailPassword(email, password))
}
但只有第一次登录有效:repo.login
每当我try 使用第二个登录:repo.dologin
时,它都会显示异常:
libc++abi: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SharedRealmRepo dologinEmail:password:completionHandler:]: unrecognized selector sent to instance 0x281fe4960'
terminating with uncaught exception of type NSException
为什么会发生这种情况?我需要以某种方式重新编译共享模块吗?