RLMObjectSchema

@interface RLMObjectSchema : NSObject <NSCopying>

This class represents Realm model object schemas.

When using Realm, RLMObjectSchema objects allow performing migrations and introspecting the database’s schema.

Object schemas map to tables in the core database.

  • Array of persisted RLMProperty objects for an object.

    Declaration

    Objective‑C

    @property (readonly, copy, nonatomic)
        NSArray<RLMProperty *> *_Nonnull properties;
  • The name of the class this schema describes.

    Declaration

    Objective‑C

    @property (readonly, nonatomic) NSString *_Nonnull className;
  • The property which is the primary key for this object (if any).

    Declaration

    Objective‑C

    @property (readonly, nonatomic, nullable) RLMProperty *primaryKeyProperty;
  • Retrieve an RLMProperty object by name.

    Declaration

    Objective‑C

    - (nullable RLMProperty *)objectForKeyedSubscript:
            (nonnull id<NSCopying>)propertyName;

    Parameters

    propertyName

    The property’s name.

    Return Value

    RLMProperty object or nil if there is no property with the given name.

  • Returns YES if equal to objectSchema

    Declaration

    Objective‑C

    - (BOOL)isEqualToObjectSchema:(nonnull RLMObjectSchema *)objectSchema;