Using Predicate Builder
November 25, 2009
I started writing fetch requests and my mind began to remind me that I had seen something interesting about creating a NSFetchRequest using a GUI tool. I pulled up my data model in Xcode and fired up predicate builder. I knew there was a nice GUI way to generate the predicates without fussing with the tricksy predicate language. My problem was, “how to create a variable that I could use at runtime to substitute with a value. The answer was not immediately obvious. I stared for a while at the sheet below and tried various clicks to try and squeeze the functionality out of the screen below to no avail. Then I did a quick google search and came up with an interesting article. It’s a bit dated, but it provided a good explanation of the screen below and laid the secrets of the predicate builder bare. Behold the predicate builder tutorial! (*hint* right-click just to the left of the ”-“ sign)