1

I want to execute a fetch request where I should get only those entities in result whose particular attributes have a nil value. (say attribute: firstName). So How will I write it in following format ? Everything I have in place, just want to know how to add predicate for nil value condition. This predicate gives me error: fetchRequest.predicate = NSPredicate(format: "firstName == %@", nil)

Tejas
  • 1,050
  • 12
  • 23

1 Answers1

1

Here you are:

fetchRequest.predicate = NSPredicate(format: "firstName == NIL")
Joe Smith
  • 1,900
  • 1
  • 16
  • 15