Let's say I have inserted 10.000 Book entities and 10.000 Author entities, and need to setup one to one relationships between them. Both entities have an attribute called bookID. I do this:
My problem is memory allocation going overboard. How do I limit that? I tried [fetchRequest setBatchSize:], setFetchLimit: in conjunction with setFetchOffset:, with no luck.
I don't think you are conceptualizing your data model correctly. An attribute "bookID" shouldn't really be in the Author Entity. Also it seems strange to have a one to one relationship in both ways. More likely you would want to have a one-to-many relationship from Author to Book (an author could write multiple books), and potentially even a one-to-many relationship in the opposite direction as well (a book could have multiple authors, although that is up to you).
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.