Daniel
03/20/2023, 12:15 PMrepo.login(email: $userId.wrappedValue, password: $password.wrappedValue) { user, error in
}
I have 2 methods that login identically on my Realm repository.
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))
}
But just the first login works: repo.login
Whenever I try to use the second login: repo.dologin
, it will show the exception:
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
Why this happens? Do I need to recompile the shared module in some way?Evegenii Khokhlov
03/20/2023, 1:28 PMrepo.dologin
from some closure and repo
instance no longer exists. probably it can be fixed if you will use self.repo.dologin
. I am pretty sure there is no problem with method name or with shared module compilation, in that case you would have compile-time error, not runtimeDaniel
03/20/2023, 5:24 PMself
..Daniel
03/20/2023, 5:25 PMDaniel
03/20/2023, 5:25 PM'NSInvalidArgumentException', reason: '-[SharedRealmRepo dologinEmail:password:completionHandler:]: unrecognized selector sent to instance 0x282e0c450'
Daniel
03/20/2023, 5:52 PMself.repo.login(email: $userId.wrappedValue){user, error in
Daniel
03/20/2023, 5:53 PM[SharedRealmRepo loginEmail:completionHandler:]: unrecognized selector sent to instance 0x2806c98c0'
Daniel
03/20/2023, 5:54 PMDaniel
03/20/2023, 6:15 PMDaniel
03/20/2023, 6:52 PM