i am using Core Data for the first time in my iOS application. I am testing how it works, but i have some problems like this : I have 3 entities (Page, User, Note), my application is a book, a user can consult the pages and take notes, the user can take several notes in several pages. How i can organize the model of my objects in core Data and the relationships between my Objects. thanks.
Share
For starters, you might add a Book entity which has to-many relationships with Page and Note. You could also add methods to Book like
-pageForPageNumber:and-notesForPage:just to make it easy to access the things you’re likely to need. If your app represents a single book, then you can have some appropriate class like your app delegate or your root view controller fetch the one instance of Book in the store. If your app is more like a reader that contains multiple books, you might instead start by fetching all the books and displaying them in a list so that the user can choose one.