简体   繁体   中英

Adding objects to Core Data graphically

I am pretty new to using Core Data, so I'd like to ask how I graphically add items to the database I am making. With graphically I mean like in navicat I can edit things with editor.

May be am not clear with the term graphically. When you start creating your model using Core data, you need to choose a data model from project resources (of type .xcdatamodel) and when you select this,it wil open a model editor for you. you can create as many entities, related attributes and establish relationships. Hope this will help you.

~Manoj.

If you just need to instantiate a new entity and add it to your data store, you'll use the method insertNewObjectForEntityForName on NSEntityDescription to create a new instance of your entity and insert it into your context. You have to call saveChanges on the context to persist that new entity to your data store. Core Data is a really powerful framework, but it isn't something most developers can just start using blindly. Read the Core Data guide , download some of the sample code, and you'll be rocking in no time.

Core Data is a object oriented framework that provides object persistence, not a visual database editor. Xcode contains a visual tool for creating and editing Core Data models, which are similar to database schemas, but there's no visual facility for managing or manipulating the data that a model describes. It can take a little while to understand Core Data; I'd suggest starting with Apple's Core Data Tutorial for iOS .

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