RLMProperty

Objective-C


@interface RLMProperty : NSObject

迅速

@_nonSendable(_assumed) class RLMProperty : NSObject, @unchecked Sendable

RLMProperty 实例表示由对象模式上下文中的 Realm 托管的属性。此类属性可能会持久保存在 Realm 文件中,也可能会根据 Realm 中的其他数据进行计算。

使用 Realm 时, RLMProperty实例允许执行迁移和内省数据库模式。

这些属性实例映射到核心数据库中的列。

属性

  • 属性的名称。

    声明

    Objective-C

    @property (nonatomic, readonly) NSString *_Nonnull name;

    迅速

    var name: String { get }
  • 属性的类型。

    声明

    Objective-C

    @property (nonatomic, readonly) RLMPropertyType type;

    迅速

    var type: RLMPropertyType { get }
  • 指示此属性是否已编制索引。

    RLMObject

    声明

    Objective-C

    @property (nonatomic, readonly) BOOL indexed;

    迅速

    var indexed: Bool { get }
  • 对于RLMObjectRLMCollection属性,存储在属性中的对象类的名称。

    声明

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *objectClassName;

    迅速

    var objectClassName: String? { get }
  • 对于链接对象属性,指的是链接对象属性所链接到的属性的名称。

    声明

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *linkOriginPropertyName;

    迅速

    var linkOriginPropertyName: String? { get }
  • 指示此属性是否可选。

    声明

    Objective-C

    @property (nonatomic, readonly) BOOL optional;

    迅速

    var optional: Bool { get }
  • 指示此属性是否为数组。

    声明

    Objective-C

    @property (nonatomic, readonly) BOOL array;

    迅速

    var array: Bool { get }
  • set

    指示此属性是否为集合。

    声明

    Objective-C

    @property (nonatomic, readonly) BOOL set;

    迅速

    var set: Bool { get }
  • 指示此属性是否为字典。

    声明

    Objective-C

    @property (nonatomic, readonly) BOOL dictionary;

    迅速

    var dictionary: Bool { get }
  • 指示此属性是数组还是集。

    声明

    Objective-C

    @property (nonatomic, readonly) BOOL collection;

    迅速

    var collection: Bool { get }

方法

  • 返回给定属性对象是否等于接收器。

    声明

    Objective-C

    - (BOOL)isEqualToProperty:(nonnull RLMProperty *)property;

    迅速

    func isEqual(to property: RLMProperty) -> Bool