RLMRealmConfiguration

@interface RLMRealmConfiguration : NSObject <NSCopying>

An RLMRealmConfiguration is used to describe the different options used to create an RLMRealm instance.

RLMRealmConfiguration instances are just plain NSObjects, and unlike RLMRealm and RLMObjects can be freely shared between threads as long as you do not mutate them. Creating configuration objects for class subsets (by setting the objectClasses property) can be expensive, and so you will normally want to cache and reuse a single configuration object for each distinct configuration that you are using rather than creating a new one each time you open a Realm.

  • Returns the default configuration used to create Realms when no other configuration is explicitly specified (i.e. +[RLMRealm defaultRealm]).

    Declaration

    Objective‑C

    + (nonnull instancetype)defaultConfiguration;

    Return Value

    The default Realm configuration.

  • Sets the default configuration to the given RLMRealmConfiguration.

    Declaration

    Objective‑C

    + (void)setDefaultConfiguration:(nonnull RLMRealmConfiguration *)configuration;

    Parameters

    configuration

    The new default Realm configuration.

  • The local URL to the realm file. Mutually exclusive with inMemoryIdentifier.

    Declaration

    Objective‑C

    @property (readwrite, copy, nonatomic, nullable) NSURL *fileURL;
  • The path to the realm file. Mutually exclusive with inMemoryIdentifier.

    Declaration

    Objective‑C

    @property (readwrite, copy, nonatomic, nullable) NSString *path;
  • A string used to identify a particular in-memory Realm. Mutually exclusive with path.

    Declaration

    Objective‑C

    @property (readwrite, copy, nonatomic, nullable) NSString *inMemoryIdentifier;
  • 64-byte key to use to encrypt the data.

    Declaration

    Objective‑C

    @property (readwrite, copy, nonatomic, nullable) NSData *encryptionKey;
  • Whether the Realm is read-only (must be YES for read-only files).

    Declaration

    Objective‑C

    @property (assign, readwrite, nonatomic) BOOL readOnly;
  • The current schema version.

    Declaration

    Objective‑C

    @property (assign, readwrite, nonatomic) uint64_t schemaVersion;
  • The block which migrates the Realm to the current version.

    Declaration

    Objective‑C

    @property (readwrite, copy, nonatomic, nullable)
        RLMMigrationBlock migrationBlock;
  • The classes persisted in the Realm.

    Declaration

    Objective‑C

    @property (readwrite, copy, nonatomic, nullable) NSArray *objectClasses;