Predicate Programming Guide
https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Predicates/AdditionalChapters/Introduction.html#//apple_ref/doc/uid/TP40001789
Predicates provide a general means of specifying queries in Cocoa. The predicate system is capable of handling a large number of domains, including Core Data and Spotlight. This document describes predicates in general, their use, their syntax, and their limitations.
At a Glance
In Cocoa, a predicate is a logical statement that evaluates to a Boolean value (true or false). There are two types of predicate, known as comparison and compound:
A comparison predicate compares two expressions using an operator. The expressions are referred to as the left hand side and the right hand side of the predicate (with the operator in the middle). A comparison predicate returns the result of invoking the operator with the results of evaluating the expressions.
A compound predicate compares the results of evaluating two or more other predicates, or negates another predicate.
Cocoa supports a wide range of types of predicate, including the following:
Simple comparisons, such as
grade == 7
orfirstName like 'Mark'
Case or diacritic insensitive lookups, such as
name contains[cd] 'citroen'
Logical operations, such as
(firstName beginswith 'M') AND (lastName like 'Adderley')
You can also create predicates for relationships—such as group.name matches 'work.*'
, ALL children.age > 12
, and ANY children.age > 12
—and for operations such as @sum.items.price < 1000
.
Cocoa predicates provide a means of encoding queries in a manner that is independent of the store used to hold the data being searched. You use predicates to represent logical conditions used for constraining the set of objects retrieved by Spotlight and Core Data, and for in-memory filtering of objects.
You can use predicates with any class of object, but a class must be key-value coding compliant for the keys you want to use in a predicate.
Predicate Programming Guide的更多相关文章
- 【IOS笔记】View Programming Guide for iOS -1
原文:View Programming Guide for iOS View and Window Architecture Views and windows present your applic ...
- Quartz 2D Programming Guide
Quartz 2D Programming Guide 官方文档: Quartz 2D Programming Guide 译文: Quartz 2D编程指南(1) - 概览 Quartz 2D编程 ...
- [IoLanguage]Io Programming Guide[转]
Io Programming Guide Introduction Perspective Getting Started Downloading Installing Binaries Ru ...
- Structured Streaming Programming Guide结构化流编程指南
目录 Overview Quick Example Programming Model Basic Concepts Handling Event-time and Late Data Fault T ...
- GraphX学习笔记——Programming Guide
学习的资料是官网的Programming Guide https://spark.apache.org/docs/latest/graphx-programming-guide.html 首先是Gra ...
- View Programming Guide for iOS_读书笔记[正在更新……]
原文:View Programming Guide for iOS 1 Introduction 先熟悉一下基本概念. Window Windows do not have any visible c ...
- OpenGL® ES 3.0 Programming Guide - Book Website
OpenGL® ES 3.0 Programming Guide - Book Website http://opengles-book.com sample codes in GitHub: htt ...
- 对Spark2.2.0文档的学习3-Spark Programming Guide
Spark Programming Guide Link:http://spark.apache.org/docs/2.2.0/rdd-programming-guide.html 每个Spark A ...
- Spark Streaming Programming Guide
参考,http://spark.incubator.apache.org/docs/latest/streaming-programming-guide.html Overview SparkStre ...
随机推荐
- 永恒之蓝(EternalBlue)MS17-010
附加知识: 漏洞来源与背景: 这个漏洞最初是由NSA(美国国家安全局)发现的,但是他们发现漏洞他不讲,然后遭殃了吧. 后来 有一个黑客组织叫:Shadow Brokers (影子经纪人) 入侵了NSA ...
- HDU - 5534 Partial Tree(每种都装的完全背包)
Partial Tree In mathematics, and more specifically in graph theory, a tree is an undirected graph in ...
- .Net HttpWebRequest 爬虫核心爬取
1 爬虫,爬虫攻防 2 下载html 3 xpath解析html,获取数据和深度抓取(和正则匹配) 4 多线程抓取 熟悉http协议 提供两个方法Post和Get public static stri ...
- MVC+NHibernate笔记
Nhibernate 要求model实体类对于lazy="true" ,字段属性前需要加 virtual sqlserver2005和oracle10g的hibernate.cfg ...
- Java 普通方法和构造方法的区别
构造方法: ①方法名和 类名相同 ②在方法名的前面没有返回值类型的声明 ③在方法中不能使用return语句返回一个值 ④在创建对象时,要调用new,如:book b1=new book(); ⑤当没有 ...
- 初步了解XMLHttpRequest对象、http请求的封装
构造器 var xhr = new XMLHttpRequest() 设置超时时间 xhr.ontimeout= 设置超时时间为 1s 设置超时时间(单位:ms) 0为永不超时 HTTP 请求的状态 ...
- Solr highlight
hl.preserveMulti 默认是false.Set to true to perform highlighting on all values of a multivalued field a ...
- CentOS设置代理, yum, wget
/etc # vi yum.conf [main] cachedir=/var/cache/yum/basearch/releasever keepcache=0 debuglevel=2 logfi ...
- 洛谷P4318 完全平方数(容斥,莫比乌斯反演)
传送门 求第$k$个没有完全平方数因数的数 一开始是想筛一波莫比乌斯函数,然后发现时间复杂度要炸 于是老老实实看了题解 一个数的排名$k=x-\sum_{i=1}^{x}{(1-|\mu(i)|)}$ ...
- MyBatis入门Bug集锦X1