我注意到在iOS 11上有核心数据的R树索引。如果创建了这个索引,那么该模型是否与较低的iOS版本不兼容?或者,它只是被忽略了吗?
https://developer.apple.com/documentation/coredata/nsfetchindexelementtype/2887046-rtree
发布于 2017-10-06 17:46:18
是的,那么模型是不兼容的。我唯一没有发现的是,如何为低于iOS 11的目标编译模型,使其与苹果在Release Notes中所说的旧世界兼容。
我的解决方法现在是让SDK自动推断映射模型:
NSDictionary *pscOptions = @{
NSMigratePersistentStoresAutomaticallyOption : @YES,
NSInferMappingModelAutomaticallyOption : @YES,
NSSQLitePragmasOption : @{ @"journal_mode" : @"WAL"}//iOS >=7 Default behaviour
};
[self.persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType
configuration:nil
URL:[self sourceStoreURL]
options:pscOptions
error:&error]https://stackoverflow.com/questions/46473002
复制相似问题