After the Xcode 9.3 update, I've noticed that if you want to have Predicate like this:
let predicate = NSPredicate(format: "preferred = %@", true as CVarArg)
You have a crash. But in Xcode 9.2 this wasn't a problem. Any idea?
After the Xcode 9.3 update, I've noticed that if you want to have Predicate like this:
let predicate = NSPredicate(format: "preferred = %@", true as CVarArg)
You have a crash. But in Xcode 9.2 this wasn't a problem. Any idea?
I think you can also use this:
// Solution 3 [ Apple Documentation ]
The exception occurs because
true
is not an object (%@
). You need the%d
placeholderAfter a bit of investigation, I've discovered how to fix this. In short:
As also explained here, it's simply better to deal with Obj-C type instead of Swift type when we have to deal with this kind of methods.