nskeyedarchiver 在 OS X 和 iOS 之间的兼容性

发布于 2024-12-05 04:04:18 字数 89 浏览 4 评论 0原文

如果我在桌面 cocoa 应用程序和 iOS 应用程序之间共享一个实现 NSCoding 协议的类,我是否也能够在这两个应用程序之间共享通过归档对象创建的数据文件?

If I share a class implementing the NSCoding protocol between a desktop cocoa application and an iOS application, will I also be able to share a datafile created by archiving an object between those two applications?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

叫嚣ゝ 2024-12-12 04:04:18

使用 NSKeyedArchiver 存档的文件在两个平台之间兼容。您只需留意在两个平台上均不可用的类,例如:

  • NSColor / UIColor
  • NSImage / UIImage
  • ...

由于这些类在两个平台上均不可用,因此您将无法在另一个平台上取消存档它们。

Files archived with NSKeyedArchiver are compatible between both plattforms. You just have to look out for classes that are not available on both plattforms like:

  • NSColor / UIColor
  • NSImage / UIImage

Since those are not available on both plattforms you will not be able to unarchive them on the other plattform.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文