Core Data中的对象关系图
2016-05-08 14:23:52 1 举报
在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 条评论
回复 删除
下一页