let context = NSManagedObjectContext(concurrencyType: .MainQueueConcurrencyType)
context.dropEntity("User")
let context = NSManagedObjectContext(concurrencyType: .MainQueueConcurrencyType)
let count = context.countEntity("User")
let context = NSManagedObjectContext(concurrencyType: .MainQueueConcurrencyType)
let users: [User] = context.fetchEntity("User")
SweetCoreData 通过 CocoaPods 获得。要安装它,只需将以下行添加到 Podfile
pod 'SweetCoreData'
SweetCoreData 也通过 Carthage 获得。要安装它,只需将以下行添加到 Cartfile
github "bakkenbaeck/SweetCoreData"
SweetCoreData 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。
Bakken & Bæck, @bakkenbaeck