predicateForObjects(withMetadataKey:)
Returns a predicate that matches any object whose metadata contains the provided key.
Declaration
class func predicateForObjects(withMetadataKey key: String) -> NSPredicateParameters
- key:
The metadata key to match. For a list of preset keys, see Metadata Keys. You may also search for custom keys.
Return Value
A predicate that matches any object whose metadata contains the provided key.
Discussion
Use this convenience method to create a predicate that finds all objects with a specific key stored in their metadata. The following sample uses both the convenience method and a predicate format string to create equivalent predicates.
See Also
Related Documentation
Creating object predicates
predicateForObject(with:)predicateForObjects(with:)predicateForObjects(from:)predicateForObjects(from:)predicateForObjects(from:)predicateForObjects(withDeviceProperty:allowedValues:)predicateForObjects(from:)predicateForObjects(withMetadataKey:allowedValues:)predicateForObjects(withMetadataKey:operatorType:value:)predicateForObjectsWithNoCorrelation()