CoreDataLite 1.0.1

CoreDataLite 1.0.1

测试已测试
语言语言 Obj-CObjective C
许可 MIT
发布最后发布2016年1月

Prabodh Prakash 维护。



需求

  • 您需要在您的 Mac 上安装 Cocoapods。

将 Pod 添加到项目 Podfile 中

pod 'CoreDataLite', '~> 0.0'

库使用

此库为 Objective-C 中的 CoreData 提供了一个轻量级样板代码。

以下代码展示了如何获取 CoreDatabaseInterface 的实例

  [[CoreDataManager sharedManager] setupCoreDataWithKey:self.dbName storeKey:@"dbName" objectModelIdentifier:@"databaseIdentifier"];

    CoreDatabaseInterface* coreDatabaseInterface = [[CoreDataManager sharedManager] getCoreDataInterfaceForKey:@"dbName"];

CoreDataManager 是一个单例类,它将 CoreDatabaseInterface 的实例存储在一个字典中,键必须与数据库名称相同,以确保不会创建具有类似名称的两个数据库。

CoreDatabaseInterface 提供了以下方法来返回

  1. 在私有队列和主队列上的 NSManagedObjectContext。
  2. NSPersistentStoreCoordinator
  3. NSManagedObjectModel

这些方法可用于对 CoreData 执行操作。

此外,CoreDatabaseInterface 还提供

  1. 串行队列
  2. 并发队列,可用于在串行或并行中运行查询。

贡献

我们期待您的贡献,请在问题跟踪器中报告错误,创建合并请求(在 develop 分支上)并建议新功能(也请在问题跟踪器中提出)。

许可 & 信用

CoreDataLite 在MIT 许可证下可用,因此您可以在商业和非商业项目中自由使用它。

作者

Mudit Krishna Mathur [email protected]

Prabodh Prakash [email protected]