Instance Method


Fetches all groups matching the specified predicate.


- (NSArray<CNGroup *> *)groupsMatchingPredicate:(NSPredicate *)predicate error:(NSError * _Nullable *)error;



The predicate to use to fetch the matching groups. Set predicate to nil to match all groups.


Error information, if an error occurred.

Return Value

An array of CNGroup objects that match the predicate.


This method returns an empty array when no matching groups are found. If an error occurs, this method returns nil. You should use only the predicates defined in CNGroup class predicates. Compound predicates are not supported. Contacts may be members of one or more groups, depending upon the account they come from.

See Also

Fetching Groups and Containers

- defaultContainerIdentifier

Returns the identifier of the default container.

- containersMatchingPredicate:error:

Fetches all containers matching the specified predicate.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software