CoreData的使用_Xcode10.1附Demo(2019-04-01)

说明: 是使用Xcode10.1环境,搜索结果使用NSFetchedResultsController 来展示结果.

CoreData的使用_Xcode10.1附Demo(2019-04-01)_第1张图片
结果图.png

这是我的之前一篇文章(Xcode 8.1 )CoreData 的使用CoreData创建流程,不管是Xcode8.1还是Xcode10.1,其创建流程都是一样的,所以就直接拿过来用了.
注意:上次是使用Swift 3.0 这次使用的是OC.

创建过程
CoreData的使用_Xcode10.1附Demo(2019-04-01)_第2张图片
coreData第一步.jpg
CoreData的使用_Xcode10.1附Demo(2019-04-01)_第3张图片
coreDataDemo第二步.jpg
CoreData的使用_Xcode10.1附Demo(2019-04-01)_第4张图片
CoreDataDemo第三步.jpg
CoreData的使用_Xcode10.1附Demo(2019-04-01)_第5张图片
coreDataDemo 第四步.jpg
CoreData的使用_Xcode10.1附Demo(2019-04-01)_第6张图片
coreDataDemo 第五步.jpg
CoreData的使用_Xcode10.1附Demo(2019-04-01)_第7张图片
修改模式.jpg
CoreData的使用_Xcode10.1附Demo(2019-04-01)_第8张图片
手动生成对应文件.jpg
CoreData的使用_Xcode10.1附Demo(2019-04-01)_第9张图片
生成对应文件.jpg
CoreData的使用_Xcode10.1附Demo(2019-04-01)_第10张图片
引入头文件.jpg

接下来就是正常使用了.把结果用NSFetchedResultsController 来展示结果.
CoreData 官网使用

NSFetchedResultsController 官方指导使用

Demo地址

你可能感兴趣的:(CoreData的使用_Xcode10.1附Demo(2019-04-01))