I'm having problems with NSPredicate. It started because for some conditions I got empty lists when I knew there was something in the model. I've made a lot of tests and I found that it fails when I use %@ (to have a variable). If I write the variable directly, it works fine. But in some situations, it works fine when I have a %@, but if I add a second variable with AND it gives again an empty list. I've checked that the context, the spelling are fine. Also, the objects do exist, since I get them by typing the variable directly. For some reason, I get an empty list in some situation (which are always the same situations, it doesn't happen randomly). I think the problem is that CoreData gives and error, so I get an empty list as the default. Does anyone know what could be happening?
CoreData: NSPredicate sometimes gives empty lists with SwiftUI
I found the issue, it was that for Int we have to use %i, but I had %a