Instance Method

initWithRecordID:action:

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

Declaration

- (instancetype)initWithRecordID:(CKRecordID *)recordID action:(CKReferenceAction)action;

Parameters

recordID

The ID of the target record. This method throws an exception if you specify nil for this parameter.

action

The ownership option to put in place between the target record and any records that incorporate this reference object. If you specify the CKReferenceActionDeleteSelf option, the record referred to by the recordID parameter owns (or acts as the parent) 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 when you have only the ID of the record that is to become the target of a link. You might use this method if you saved only the ID of the record to a local data cache.

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

- initWithRecord:action:

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

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