I have use core data in app, I have definite a class that most like as follows:
@interface Master : NSManagedObject {
}
@property (nonatomic, retain) NSSet* Details; ....
the entity Master contains a propert开发者_运维技巧y 'Details' that is relate to another table, this is typical Master->Details relationship, I trace the app , but I find a issue that the property 'Details' value was construct even it never be invoked .....
but I consider that the core data 'should' use some lazy mechanism to improve performance, or maybe I miss some configure step ? because the Master entity contains at least five 'Child' table properties , I have to consider this problem before use the core data ....
any help ? thanks for your time!
If you are trying to establish a relationship between two entities in Core Data, you create the relationship directly inside your Data Model (.xdatamodel) file.
Typically you would not create your own NSManagedObject
subclass like this. Instead, you will create your entities in your Data Model, select them in their list, and then use Xcode to automagically generate the .h and .m files for each entity.
See the Core Data Programming Guide for more details.
精彩评论