CoreData
1. Common Classes and methods ( Note the need to import the coredata framework )
Table structure: nsentitydescription
Table record: Nsmanagedobject database storage method: Nspersistentstorecoordinator (persistent storage Coordinator) Database operations: Nsmanagedobjectcontext (Managed object context)
Technology blog http://www.cnblogs.com/ChenYilong/Sina Weibo http://weibo.com/luohanchenyilong
2. Xcode Graphics Management
2.3.4.
Technology blog http://www.cnblogs.com/ChenYilong/Sina Weibo http://weibo.com/luohanchenyilong
2.manipulating databases
Technology blog http://www.cnblogs.com/ChenYilong/Sina Weibo http://weibo.com/luohanchenyilong
I. Connecting the database
- You first need to create a context for the operational database. Nsmanagedobjectcontext
- The context of the operational database requires a scheduler attribute, which is used to graphically
The established model and database are linked together.
- Add a database to the dispatcher that needs to be contacted.
Two. Add, UPDATE, delete
Add to:
1. New entity INST (insert) 2. Set the properties of an entity
3. Save the context update:
1. Determine if there is an identical model 2. Set entity Properties
3. Save context Delete three. Query
1. Using the Nsfetchedresultscontroller Controller
2.1 The proxy method of the fetch result controller is automatically invoked when the content of the manipulation data context changes
3.
Technology blog http://www.cnblogs.com/ChenYilong/Sina Weibo http://weibo.com/luohanchenyilong
Note: Be sure to perform a fetch request, and the returned data is in sections, and the array is loaded with objects that comply with the Nsfetchedresultssectioninfo protocol. Pass
Numberofobjects will be able to get a set of how many data objects.
Query tool Network: http://blog.csdn.net/ajrm0925/article/details/7410978 better document: Http://www.tuicool.com/articles/3mmIZn http:/ /blog.csdn.net/jiangshurunhe/article/details/10304309
CoreData third-party framework, with the official sample program:
Database Tools _coredata_magicalrecord-develop
Database Tools _coredata_magicalrecord-...
538.5 KB
CoreData detailed operation steps for iOS database operation (GO)