我有一个被调用的类的实例数组Contact
,其中包括以下属性:
NSArray *mailAddressList // Array of NSString
NSArray *websiteList // Array of NSString
NSArray *tags // Array of instances of Tag class
Run Code Online (Sandbox Code Playgroud)
类标记具有以下属性:
NSString *name;
UIColor *color;
Run Code Online (Sandbox Code Playgroud)
我想使用NSPredicate在每个属性的任何属性中搜索字符串Contact
.这是我的代码:
if([scope isEqualToString:SCOPE_MAIL] || [scope isEqualToString:SCOPE_WEBSITE])
{
// Search through an array
predicate = [NSPredicate predicateWithFormat:@"ANY SELF.%@ contains[c] %@", scope, textSearch];
}
else if([scope isEqualToString:SCOPE_TAG])
{
// Search another object's property
predicate = [NSPredicate predicateWithFormat:@"SELF.%@.name contains[c] %@", scope, textSearch];
}
else
{
// The rest of the properties are …
Run Code Online (Sandbox Code Playgroud) 我正在尝试突出显示PDF文档中的文本,但我找到了一个带有以下操作数的Tm运算符:
0 7.98 -7.98 0 90.8898 715.4183 Tm
Run Code Online (Sandbox Code Playgroud)
Tm运算符应该仅在其操作数上替换文本矩阵和文本行矩阵.根据Pdf参考,可以完成以下操作:
操作数的格式与上述任何转换都不匹配,这导致了以下问题.