0
let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext
do{
cards = try context.fetch(Card.fetchRequest()).
}
catch{
print(error)
}
此代碼讀取整個海量數據。如果我想只從ID讀取,該怎麼辦?像這裏「id ==%@」一樣。這個怎麼做?以及如何從ID編輯數據?核心數據3從索引讀取和寫入數據