CSWhere
@objc
public final class CSWhere : NSObject, CSFetchClause, CSQueryClause, CSDeleteClause
The CSWhere
serves as the Objective-C bridging type for Where
.
See also
Where
-
The internal
NSPredicate
instance for theWhere
clauseDeclaration
Swift
@objc public var predicate: NSPredicate { get }
-
Initializes a
CSWhere
clause with a predicate that always evaluates to the specified boolean valueMyPersonEntity *people = [transaction fetchAllFrom:CSFromClass([MyPersonEntity class]) fetchClauses:@[CSWhereValue(YES)]]];
Declaration
Swift
@objc public convenience init(value: Bool)
Parameters
value
the boolean value for the predicate
-
Initializes a
CSWhere
clause with a predicate using the specified string format and argumentsNSPredicate *predicate = // ... MyPersonEntity *people = [transaction fetchAllFrom:CSFromClass([MyPersonEntity class]) fetchClauses:@[CSWherePredicate(predicate)]];
Declaration
Swift
@objc public convenience init(format: String, argumentArray: [NSObject]?)
Parameters
format
the format string for the predicate
argumentArray
the arguments for
format
-
Initializes a
CSWhere
clause that compares equalityDeclaration
Swift
@objc public convenience init(keyPath: KeyPathString, isEqualTo value: CoreDataNativeType?)
Parameters
keyPath
the keyPath to compare with
value
the arguments for the
==
operator -
Initializes a
CSWhere
clause that compares membershipDeclaration
Swift
@objc public convenience init(keyPath: KeyPathString, isMemberOf list: [CoreDataNativeType])
Parameters
keyPath
the keyPath to compare with
list
the array to check membership of
-
Initializes a
CSWhere
clause with anNSPredicate
Declaration
Swift
@objc public convenience init(predicate: NSPredicate)
Parameters
predicate
the
NSPredicate
for the fetch or query