【发布时间】:2015-06-23 08:54:18
【问题描述】:
目前我有一个符合 NSCoding 的类,其中包含 UIBezierPath 和 UIColor。
required init(coder aDecoder: NSCoder) {
super.init()
self.lineColor = aDecoder.decodeObjectForKey("color") as! UIColor
self.bezierPath = aDecoder.decodeObjectForKey("bezier") as! UIBezierPath
}
func encodeWithCoder(aCoder: NSCoder) {
aCoder.encodeObject(lineColor, forKey: "color")
aCoder.encodeObject(bezierPath, forKey: "bezier")
}
我通过 NSKeyedArchiver 实现了这一点
NSKeyedArchiver.archivedDataWithRootObject(path)
并将其保存在服务器上 (parse.com) 我可以在 iOS 上毫无问题地解压它。但是如何兼容安卓呢?
【问题讨论】:
标签: android ios parsing parse-platform cross-platform