简体   繁体   中英

iPhone , core data, whether NSManagedObject use lazy load mechanism when it was create?

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 property '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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM