Initializer

init(record:action:)

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

Declaration

convenience init(record: CKRecord, action: CKRecord_Reference_Action)

Parameters

record

The target record of the reference.

action

The ownership options to put in place for the records. If you specify the CKRecord_Reference_Action.deleteSelf 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 CKRecord_Reference_Action.

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

init(recordID: CKRecord.ID, action: CKRecord_Reference_Action)

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