常量

以下常量全局可用。

通知常量

  • 当同一文件的写事务(write transaction)提交到不同线程上的Realm时,会发布此通知。

    如果启用了autorefresh ,或者在通知运行之前刷新了 Realm,则不会发布通知。

    禁用自动刷新的 Realm 通常应为此通知安装一个处理程序,该处理程序会在完成某些工作后调用-[RLMRealm refresh] 。 刷新Realm是可选项,但不刷新Realm可能会导致Realm文件过大。 这是因为必须为过时的Realm保留一份额外的的数据副本。

    声明

    Objective-C

    extern NS_SWIFT_NAME(RefreshRequired) const RLMNotification
        RLMRealmRefreshRequiredNotification

    Swift

    static let RefreshRequired: RLMNotification
  • 当针对同一文件的不同线程上的写事务提交到 Realm 时,Realm 会发布此通知。

    如果启用了-[RLMRealm autorefresh] ,或者在通知运行之前刷新了 Realm,则不会发布通知。

    禁用自动刷新的 Realm 通常应为此通知安装一个处理程序,该处理程序会在完成某些工作后调用-[RLMRealm refresh] 。 刷新Realm是可选项,但不刷新Realm可能会导致Realm文件过大。 这是因为Realm必须为过时的Realm保留一份额外的的数据副本。

    声明

    Objective-C

    extern NS_SWIFT_NAME(DidChange) const RLMNotification
        RLMRealmDidChangeNotification

    Swift

    static let DidChange: RLMNotification

错误键

其他常量

  • 用于未初始化 Realm 的模式版本

    声明

    Objective-C

    extern const uint64_t RLMNotVersioned

    Swift

    let RLMNotVersioned: UInt64
  • 相应的值是 Realm 抛出的异常的名称。

    声明

    Objective-C

    extern NSString *const _Nonnull RLMExceptionName

    Swift

    let RLMExceptionName: String
  • 对应的值为 Realm 文件版本。

    声明

    Objective-C

    extern NSString *const _Nonnull RLMRealmVersionKey

    Swift

    let RLMRealmVersionKey: String
  • 相应的键是底层数据库引擎的版本。

    声明

    Objective-C

    extern NSString *const _Nonnull RLMRealmCoreVersionKey

    Swift

    let RLMRealmCoreVersionKey: String
  • 相应的键是Realm失效属性名称。

    声明

    Objective-C

    extern NSString *const _Nonnull RLMInvalidatedKey

    Swift

    let RLMInvalidatedKey: String

错误域

RLMError

  • 包含错误代码名称的用户信息键。 这仅用于调试目的,不应依赖。

    声明

    Objective-C

    extern NSString *const RLMErrorCodeNameKey

    Swift

    let RLMErrorCodeNameKey: String