Reputation: 3230
NSFetchRequest has methods predicate
and setPredicate
. I wonder why Apple not make predicate a property of NSFetchRequest? That would make life a little bit easier.
More, it appears that NSFetchRequest has no properties at all.. What's the underlying principle behind this?
Upvotes: 1
Views: 121
Reputation: 539745
You can write
fetchRequest.predicate = predicate;
even if predicate
is not declared as property of NSFetchRequest
. The compiler translates this to
[fetchRequest setPredicate:predicate];
Upvotes: 2
Reputation: 16296
There's one very good reason it has no properties:
So the class predates the invention of Objective-C properties, and for whatever reason has never been revisited.
Upvotes: 4