You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you need to execute custom logic in the setter/getter of a property, you should @Ignore it so that it's not treated as persisted. So essentially, it should look something like this:
classHuman: RealmObject {
@Ignore
publicvar name:String
set(value) {
println("Example Setter called with value: $value")
name_persisted = value
}
get() {
return name_persisted
}
privatevar name_persisted:String=""
How frequently does the bug occur?
Always
Description
When I set the name with:
person.name = "John"
, the setter function is not called.I googled hard to understand about the issue, it appears this 7 years old post explained it, but obviously is regarding the Java API, seems still valid with the current Kotlin API? https://stackoverflow.com/questions/43066612/realm-call-setter
Is it possible to get the setters to work in Kotlin as that's a neat feature of the language?
Stacktrace & log output
No response
Can you reproduce the bug?
Always
Reproduction Steps
No response
Version
2.0.0
What Atlas App Services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
Android 9, Android 14
Build environment
Android Studio version: ...
Android Build Tools version: ...
Gradle version: ...
The text was updated successfully, but these errors were encountered: