---
title: "initWithDatabase:stateSerialization:delegate:"
framework: cloudkit
role: symbol
role_heading: Instance Method
path: "cloudkit/cksyncengineconfiguration/initwithdatabase:stateserialization:delegate:"
---

# initWithDatabase:stateSerialization:delegate:

Creates a configuration for the specified database and serialized state.

## Declaration

```occ
- (instancetype) initWithDatabase:(CKDatabase *) database stateSerialization:(CKSyncEngineStateSerialization *) stateSerialization delegate:(id<CKSyncEngineDelegate>) delegate;
```

## Parameters

- `database`: The database to sync — either a person’s private database or their shared database.
- `stateSerialization`: If this is the first initialization of the associated sync engine, specify nil; otherwise, specify the state from the most recent doc://com.apple.cloudkit/documentation/CloudKit/CKSyncEngineStateUpdateEvent that your delegate handled.
- `delegate`: The object that provides the records to sync and handles any related events.

## Return Value

Return Value An initialized configuration instance.
