RLMMigration Class Reference
Inherits from | NSObject |
Declared in | RLMMigration.h RLMMigration.mm |
Overview
RLMMigration is the object passed into a user defined RLMMigrationBlock when updating the version of an RLMRealm instance.
This object provides access to the RLMSchema current to this migration.
Properties
newSchema
Get the new RLMSchema for the migration. This is the schema which describes the RLMRealm after applying a migration.
@property (nonatomic, readonly) RLMSchema *newSchema
Declared In
RLMMigration.h
oldSchema
Get the new RLMSchema for the migration. This is the schema which describes the RLMRealm before the migration is applied.
@property (nonatomic, readonly) RLMSchema *oldSchema
Declared In
RLMMigration.h
Instance Methods
enumerateObjects:block:
Enumerates objects of a given type in this Realm, providing both the old and new versions of each object. Objects properties can be accessed using keyed subscripting.
- (void)enumerateObjects:(NSString *)className block:(RLMObjectMigrationBlock)block
Parameters
- className
The name of the RLMObject subclass to retrieve on eg.
MyClass.className
.
Discussion
Warning: All objects returned are of a type specific to the current migration and should not be casted to className. Instead you should access them as RLMObjects and use keyed subscripting to access properties.
Declared In
RLMMigration.h