Object’s attribute name is equal to value passed in


Download 119.39 Kb.
Pdf ko'rish
bet1/4
Sana04.11.2023
Hajmi119.39 Kb.
#1747345
  1   2   3   4
Bog'liq
NSPredicateCheatsheet



object’s attribute name is equal to value passed in
@"attributeName == %@"
pass a string variable to %K, it will be represented as a 
keypath
@"%K == %@"
templated for predicate, checks if the value of key name is 
in $NAME_LIST. Uses predicateWithSubstitutionVariables
@"%name IN $NAME_LIST"
checks if the constant value ‘name’ is in $NAME_LIST. Uses 
predicateWithSubstitutionVariables
@"'name' IN $NAME_LIST"
Format String Summary
predicateWithFormat: @"title == %@", @"minecraft"
predicateWithFormat: @"expenses BETWEEN {200, 400}"
Left hand expression is equal to right hand expression
=,==
Left hand expression is greater than or equal to right 
hand expression
>=,=>
Left hand expression is less than or equal to right hand 
expression
<=,=<
Left hand expression is greater than right hand expression
>
Left hand expression is less than right hand expression
<
Left hand expression is not equal to right hand expression
!=,<>
Left hand expression must appear in collection specified by 
right hand expression. i.e. name IN {‘Milk’, ‘Eggs’, ‘Bread’}
IN
Left hand expression is between or equal to right hand 
expression. i.e. 1 Between {0, 33}
BETWEEN
Left hand expression is between or equal to right hand 
expression. i.e. 1 Between {0, 33}
BETWEEN
Basic Comparisons
predicateWithFormat: @"name BEGINS WITH 'm'"
Left hand expression begins with the right hand 
expression
BEGINS WITH
Left hand expression contains the right hand 
expression
CONTAINS
Left hand expression ends with the right hand 
expression

Download 119.39 Kb.

Do'stlaringiz bilan baham:
  1   2   3   4




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling