常量

以下常量全局可用。

通知常量

  • 当同一文件的写事务(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

错误键

其他常量

错误域

  • 错误代码是 RLMError 枚举中的值。

    声明

    Objective-C

    extern NSString *const RLMErrorDomain

    Swift

    let RLMErrorDomain: String
  • 识别非特定系统错误的错误域。

    声明

    Objective-C

    extern NSString *const RLMUnknownSystemErrorDomain

    Swift

    let RLMUnknownSystemErrorDomain: String
  • 与同步管理器错误处理程序报告的错误相关的所有 SDK 错误的错误域string ,以及不属于任何其他类别的常规同步错误。

    声明

    Objective-C

    extern NSString *const RLMSyncErrorDomain

    Swift

    let RLMSyncErrorDomain: String
  • 与身份验证端点相关的所有 SDK 错误的错误域string 。

    声明

    Objective-C

    extern NSString *const RLMSyncAuthErrorDomain

    Swift

    let RLMSyncAuthErrorDomain: String
  • string与Atlas App Services 端点相关的所有 SDK 错误的错误域 。

    声明

    Objective-C

    extern NSString *const RLMAppErrorDomain

    Swift

    let RLMAppErrorDomain: String

RLMError

  • 已弃用

    use -[NSError code]

    包含错误代码的用户信息键。 这只是为了向后兼容,不应使用。

    声明

    Objective-C

    extern NSString *const RLMErrorCodeKey

    Swift

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

    声明

    Objective-C

    extern NSString *const RLMErrorCodeNameKey

    Swift

    let RLMErrorCodeNameKey: String
  • 用户信息键存在于源自服务器的同步错误中,其中包含与错误相关的服务器端日志的 URL。

    声明

    Objective-C

    extern NSString *const RLMServerLogURLKey

    Swift

    let RLMServerLogURLKey: String
  • 包含 HTTP 状态代码的用户信息键。 某些RLMAppError代码包含此项,尤其是RLMAppErrorHttpRequestFailed

    声明

    Objective-C

    extern NSString *const RLMHTTPStatusCodeKey

    Swift

    let RLMHTTPStatusCodeKey: String
  • 包含RLMCompensatingWriteInfo的用户信息键,其中包括有关服务器已恢复内容的更多详细信息。

    声明

    Objective-C

    extern NSString *const RLMCompensatingWriteInfoKey

    Swift

    let RLMCompensatingWriteInfoKey: String

RLMSyncError