cocoa - Using CoreData with an object? -
itemprop = "text">
This is an introductory question: Every tutorial I supported on the database on the coreata has an object model with all the relationships and whatnot I have seen Start out with drawing
But my app will be like a simple drawing app, the Illustrator light or the Omnigraphle looks. I have an object in the memory for the page and after that there are many element objects. How do you use cordata for this?
I just do not need an ending code, only signs or thoughts.
Every program design starts (or should start) data model . The data model stores not only the data for the program but also the logical connection between the pieces of the data. The data model is the guts of the program and everything else is one or more interfaces which displays the data model in some way.
Take the example of a simple drawing program that pulls a polygon. Logically, the program will start with a document. In core data this data will be represented by a document unit in the model and probably by an NSManagedObject subclass. In turn, the document (relation) will be one or more pages, pages will also have one unit and sub-section. The pages will keep data about a physical page such as margins, footers, headers etc. Polygons in a page will also be there. Each poly unit-sub-class will have the necessary information to attract the polygon, for example corner points
such that the user has attracted, the data in the controller layer data model and the data in the screen state And will then exit again as needed.
There are many benefits to using core data to create a data model.
- Core data automatically manages a very complex logical connection which is hard to track by hand.
- This creates an automatic undo system
- This makes it easy to move data between different parts of the program (in this case drawing) or to subdue any drawing, Exporting the part.
- This separates the data from a particular interface, for example, you can output a drawing from latex or just flash by writing another controller.
- This makes the application easy for scripts instead of the user interface instead of the data interface with the script interface program.
It is my understanding that Omnigraffle is based on core data, so if you want an app like Core Data is definitely the way to go.
Comments
Post a Comment