Core Data中的对象关系图
2017-04-18 09:22:31 0 举报
在Core Data中,对象关系图是用于可视化和管理数据模型中实体和关系的工具。它以图形的形式展示了实体之间的联系和层次结构。通过对象关系图,开发者可以直观地查看和编辑实体的属性、关联以及继承关系。此外,对象关系图还提供了对实体进行分组、排序和过滤的功能,使开发者能够更高效地管理和查询数据。总之,对象关系图是Core Data中一个非常重要的工具,它为开发者提供了一个直观、易于操作的方式来设计和优化数据模型。
作者其他创作
大纲/内容
nameNSString
mom = managedObjectModelmoc = managedObjectContextmo = managedObjectps = persistentStorepsc = persistentStoreCoordinatorQ1: How to get mom from moc:moc---momA1: mom = moc.psc.momQ2: mom--entityA2: [mom.entities objectForKey:entityName]因此在NSEntityDescription中就有一个集合了A1 A2功能的函数:moc-entityentityForName: inManagedObjectContext:Q3:How to create a new mo in certain moc with specified entity:[[NSManagedObject alloc] initWithEntity:insertInToManagedObjectContext:] 同样的,NSEntityDescription中从entityName 到 mo的便利函数是:insertNewObjectForEntityForName:inManagedObjectContext:
cacheNodeSetNSSet
objectIDNSManangedObjectID
objectIDNSManagedObjectID
等价
managedObjectNSManagedObject
managedObjectContextNSManagedObjectContext
value
NSAtomicStoreCacheNode
attributeNSAttributeDescription
URIRepresentationNSURL
父类:NSPersistentStore
存储
辅助存储系统
relationship关系
configurationsNSArray
[managedObject valueForKey: key]
configurationNameNSString
父类:NSPropertyDescription
fetchRequestTemplateForName:NSFetchRequest
entity.properties
cacheNodesNSAtomicStoreCacheNode
properties=[attributesByName allKeys] + [relationshipsByName allKeys]NSArray
allValues
entitiesByNameNSDictionary (value:NSEntityDescription)
atomicStoreNSAtomicStore
persistentStoresNSArray
NSManagedObject
cacheNodeNSAtomicStoreCacheNode
NSAtomicStore
propertyCacheNSMutableDictionary
Two layers inside Core Data
User Code
destinationEntityNSEntityDescription
urlNSURL
propertiesByNameNSDictionary
attributesByNameNSDictionary
relationshipsByNameNSDictionary
entitiesNSArray (NSEntityDescription)
metadataNSDictionary
attributeNameNSString
registeredStoreTypesNSDictionary
persistentStoreCoordinatorNSPersistentStoreCoordinator
managedObjectModelNSManangedObjectModel
NSAtomicStore层对象关系图
key
NSManagedObjectContext
relationshipNameNSString
inverseRelationshipNSRelationshipDescription
objectAtIndex:
attribute属性
persistentStoreNSPersistentStore
managedObjectClassNameNSString
entityNSEntityDescrption
attributeTypeNSAttribute
undoManangerNSUndoManager
relationshipNSRelationshipDescription
0 条评论
下一页