Instance Method

initWithRecordType:zoneID:

Initializes and returns a record in the specified zone.

Declaration

- (instancetype)initWithRecordType:(CKRecordType)recordType zoneID:(CKRecordZoneID *)zoneID;

Parameters

recordType

A string reflecting the type of record that you want to create. Define the record types that your app supports, and use them to distinguish between records with different types of data. This parameter must not be nil or contain an empty string.

Record type names consist of one or more alphanumeric characters and start with a letter. Type names may include underscore characters if they do not start with that character. Spaces are not allowed in record type names.

zoneID

The ID of the record zone in which to place the record.

Return Value

An initialized record object, or nil if the record cannot be created.

Discussion

Use this method to initialize a new record object in the specified record zone.

Upon creation, the new record contains no data and exists only in memory on the local device. Save the record using a CKModifyRecordsOperation object or using the saveRecord:completion: method of CKDatabase to transfer the record’s contents to the server.

See Also

Initializing a Record

- initWithRecordType:

Initializes and returns a new record of the specified type.

- initWithRecordType:recordID:

Initializes and returns a record using an ID that you provide.

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