2
の抽象オブジェクトに送信することはできませんnscoderスウィフトは、私は、コンテナアプリで辞書を作成しましたし、それを保存して、キーボード延長からそれを読んでください<a href="https://github.com/Archivus/SymSpell" rel="nofollow" title="SymSpell">SymSpell</a></p> <p>て自動補正を実装しようとしているクラスNSCoder
辞書は、私がオブジェクトにメソッドを追加しようとしましたが、私はエラー「のinit(コーダadecoderのnscoder)SWIFTがに送信することができませんしまったnSCoder
によって救われるためにシリアル化する必要がdictionaryItem
オブジェクトが含まれていますクラスNSCoderの抽象オブジェクト "
required init(coder aDecoder: NSCoder) {
if let suggestions = aDecoder.decodeObjectForKey("suggestions") as? [Int] {
self.suggestions = suggestions
}
if let count = aDecoder.decodeObjectForKey("count") as? Int {
self.count = count
}
}
func encodeWithCoder(aCoder: NSCoder) {
if let count = self.count as? Int {
aCoder.encodeObject(count, forKey: "count")
}
if let suggestions = self.suggestions as? [Int] {
aCoder.encodeObject(suggestions, forKey: "suggestions")
}
}
これを修正する方法はありますか?