Constants

The following constants are available globally.

Enums

  • An error domain identifying Realm-specific errors.

    Declaration

    Objective-C

    extern NSString *const _Nonnull RLMErrorDomain

    Swift

    let RLMErrorDomain: String
  • An error domain identifying non-specific system errors.

    Declaration

    Objective-C

    extern NSString *const _Nonnull RLMUnknownSystemErrorDomain

    Swift

    let RLMUnknownSystemErrorDomain: String

Notification Constants

  • This notification is posted when a write transaction has been committed to a Realm on a different thread for the same file.

    It is not posted if autorefresh is enabled, or if the Realm is refreshed before the notification has a chance to run.

    Realms with autorefresh disabled should normally install a handler for this notification which calls -[RLMRealm refresh] after doing some work. Refreshing the Realm is optional, but not refreshing the Realm may lead to large Realm files. This is because an extra copy of the data must be kept for the stale Realm.

    Declaration

    Objective-C

    extern NS_SWIFT_NAME(RefreshRequired) const RLMNotification
        RLMRealmRefreshRequiredNotification

    Swift

    static let RefreshRequired: RLMNotification
  • This notification is posted by a Realm when a write transaction has been committed to a Realm on a different thread for the same file.

    It is not posted if -[RLMRealm autorefresh] is enabled, or if the Realm is refreshed before the notification has a chance to run.

    Realms with autorefresh disabled should normally install a handler for this notification which calls -[RLMRealm refresh] after doing some work. Refreshing the Realm is optional, but not refreshing the Realm may lead to large Realm files. This is because Realm must keep an extra copy of the data for the stale Realm.

    Declaration

    Objective-C

    extern NS_SWIFT_NAME(DidChange) const RLMNotification
        RLMRealmDidChangeNotification

    Swift

    static let DidChange: RLMNotification

Error keys

  • Key to identify the associated backup Realm configuration in an error’s userInfo dictionary

    Declaration

    Objective-C

    extern NSString *const _Nonnull RLMBackupRealmConfigurationErrorKey

    Swift

    let RLMBackupRealmConfigurationErrorKey: String

Other Constants