Conforms to NSObject
Declared in NMBModelMapper.h

Overview

The instance confirms this protocol is responsible for mapping entities and properties among different versions of NSManagedObjectModel.

Instance Methods

bundlesContainModelFilesContext:

Ask the model mapper the bundles contain the model files.

- (NSArray *)bundlesContainModelFilesContext:(id)context

Parameters

context

The object asking this information.

Return Value

An array of bundles contain model files.

Discussion

If this method is not implemented, main bundle is used.

Declared In

NMBModelMapper.h

currentMOModelNameOfMOMDirectory:bundle:context:

Ask the model mapper which version does the managed object model currently use.

- (NSString *)currentMOModelNameOfMOMDirectory:(NSString *)momdName bundle:(NSBundle *)bundle context:(id)context

Parameters

momdName

The name of managed object model directory being asked.

bundle

The bundle containts the managed object model directory being asked.

context

The object asking this information.

Return Value

The file name of model’s current version.

Discussion

If this method is not implemented, the name of the model is searched in the managed object model directory (momd).

Declared In

NMBModelMapper.h

entityNamed:context:

Ask the model mapper to return the NSEntityDescription for the given name in currently used model.

- (NSEntityDescription *)entityNamed:(NSString *)name context:(id)context

Parameters

name

The NSEntityDescription of the property being asked.

context

The object asking this information.

Return Value

The NSEntityDescription for the given name.

Discussion

If the method returns nil, the entity is considerred abandoned, and related objects will be deleted with the entity folder. If this method is not implemented, the entity is searched in currently used model.

Declared In

NMBModelMapper.h

isMigrationLightweightFromStore:toStore:context:

Ask the model mapper if the migration between stores presented by the 2 given metadata is a lightweight migration.

- (BOOL)isMigrationLightweightFromStore:(NSDictionary *)fromStoreMetadata toStore:(NSDictionary *)toStoreMetadata context:(id)context

Parameters

fromStoreMetadata

The metadata presents the source store of the migration.

toStoreMetadata

The metadata presents the destination store of the migration.

context

The object asking this information.

Return Value

If the migration between stores presented by the 2 given metadata is a lightweight migration.

Discussion

If this method is not implemented, the migration is treated as lightweight, and if a proper mapping model can’t be inferred, an exception will be thrown.

Declared In

NMBModelMapper.h

isModelVersionIDs:lowerThanModelVersionIDs:context:

Ask the model mapper the order of the 2 given groups of verion identifiers.

- (BOOL)isModelVersionIDs:(NSSet *)versionIDs1 lowerThanModelVersionIDs:(NSSet *)versionIDs2 context:(id)context

Parameters

versionIDs1

The first group of version identifiers need to be compared.

versionIDs2

The second group of version identifiers need to be compared.

context

The object asking this information.

Return Value

If the first group of version identifiers is lower then the second group.

Discussion

If this method is not implemented, identifiers are treatd as pure number and the average values are used to compare.

Declared In

NMBModelMapper.h

propertyNamed:ofEntity:context:

Ask the model mapper to return the NSPropertyDescription for the given name of the given entity in currently used model.

- (NSPropertyDescription *)propertyNamed:(NSString *)name ofEntity:(NSEntityDescription *)entity context:(id)context

Parameters

name

The name of the property being asked.

entity

The entity which the being asked property belongs to.

context

The object asking this information.

Return Value

The NSPropertyDescription for the given name of the given entity.

Discussion

If the method returns nil, the property is considerred abandoned, and related objects will be deleted. If this method is not implemented, the property is searched in currently used model.

Declared In

NMBModelMapper.h