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 == 7orfirstName 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 ...
随机推荐
- HDU 1512 Monkey King (左偏树+并查集)
题意:在一个森林里住着N(N<=10000)只猴子.在一开始,他们是互不认识的.但是随着时间的推移,猴子们少不了争斗,但那只会发生在互不认识 (认识具有传递性)的两只猴子之间.争斗时,两只猴子都 ...
- yzm10与战地信使 yzm10原创系列
yzm10与战地信使 M国与R国正进行着激烈的鏖战,此时的yzm10从R国窃取了最高军事机密,这份情报将是此次战役的转折点,如果M国得到了这份情报,就能够取得这次战争的胜利.yzm10当然是站在M国这 ...
- Python 获取页面title
#!/usr/bin/python #coding=utf- #urllib2是python自带的模块,在python3.x中被改为urllib.request import urllib.reque ...
- cogs1583. [POJ3237]树的维护
1583. [POJ3237]树的维护 http://www.cogs.pro/cogs/problem/problem.php?pid=1583 ★★★☆ 输入文件:maintaintree.i ...
- glassfish cluster 搭建
http://blog.csdn.net/wych1981/article/details/8815150
- 正整数构成的线性表存放在单链表中,编写算法将表中的所有的奇数删除。(C语言)
/* 正整数构成的线性表存放在单链表中,编写算法将表中的所有的奇数删除 */ #include <stdio.h> #include <stdlib.h> typedef st ...
- Photoshop CC 2014 for mac破解版
https://pan.baidu.com/s/1gfmTq8b 安装PS试用版后,打开Applications/Photoshop CC 2014文件夹下, 右键Photoshop CC 201 ...
- IDEA | 创建启动SpringBoot项目命令
clean package spring-boot:run -Dmaven.test.skip=true
- CentOS与Ubuntu修改主机名
CentOS 1.执行hostname查看主机名 2.hostname + 主机名 使需要修改的主机名立即生效,但是下次重启会失效,故需要执行第三步 3.vim /etc/sysconfig/net ...
- Codeforces 140B(模拟)
要点 题意读好久.大概这样理解:每个时间点按顺序收到序号1-n的卡片,只有收过的卡片才能发给别人并且主人公会发在他心中优先级最高的.由于主人公可以在任何时间给朋友发卡片,最后输出(说得很绕但等价于)1 ...