0
我有這樣的結構:的iOS - 保存結構的陣列中CoreData
struct list
{
var userId: Int = 0
var id: Int = 0
var title: String = ""
var body: String = ""
}
在我的程序的其他部分,我宣佈的結構數組,我通過從互聯網上下載一個JSON文件中輸入信息。
var array = [list]()
現在我的問題是保存和恢復CoreData中的這個結構數組。我不知道如何前進,你會幫我一把嗎?
什麼是您的CoreData模型?檢查這個http://stackoverflow.com/questions/37876275/how-do-i-store-a-swift-struct-in-core-data-on-ios –