1
我有多个领域的文件,(登录到我的应用程序每个用户一个),我需要在文件系统中运行的每一个领域的文件迁移执行多个.realm文件境界迁移
RLMRealmConfiguration *config = [RLMRealmConfiguration defaultConfiguration];
config.schemaVersion = 1;
config.migrationBlock = ^(RLMMigration *migration, uint64_t oldSchemaVersion) {
if (oldSchemaVersion < 1) {
//do the same changes for all file.realm in the filesystem
}
};
[RLMRealmConfiguration setDefaultConfiguration:config];
[RLMRealm defaultRealm];
怎么能为每个文件系统数据库执行领域迁移,而不仅仅是默认领域文件?
config.path = @ “路径1”;必须是.realm文件的名称?或nsurl到领域的文件,感谢这个答案! – Spaceghost
path是领域文件的字符串路径。由' - [RLMRealm path]'给出的相同值。 – jpsim
这也许会派上用场:http://stackoverflow.com/questions/33828851/migrating-multiple-realms-realm-version-greater-than-schema-version-exception/33828852#33828852 –