Instance Method

initWithRecord:action:

Initializes and returns a reference object that points to the specified record object.

Declaration

- (instancetype)initWithRecord:(CKRecord *)record action:(CKReferenceAction)action;

Parameters

record

The target record of the reference.

action

The ownership options to put in place for the records. If you specify the CKReferenceActionDeleteSelf option, the object referred to by the recordID parameter becomes the owner of any objects that use this reference object. For a list of possible values, see CKReferenceAction.

Return Value

An initialized reference object that points to the specified record, or nil if the reference cannot be initialized.

Discussion

Use this method to initialize a reference to a local record object. The local record can be one that you just created or one that you fetched previously from the server.

When you create a reference object for use in a search predicate, the predicate ignores the value in the action parameter. Search predicates use only the ID of the record during their comparison.

See Also

Initializing a Reference Object

- initWithRecordID:action:

Initializes and returns a reference object that points to the record with the specified ID.

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