在 C#/.NET 中从 Apple/Objective-C 读取持久数据
是否有C#/.NET 库或其他现有代码可以从 Apple 的序列化 API 读取持久数据,即 NSKeyedArchiver、NSKeyedUnarchiver、NSCoder
?
背景:我的一个朋友为一些苹果设备创建了一个很酷的应用程序。我有一个类似的 Microsoft 世界应用程序,想要导入他的文档。数据位于包含所有必要内容的单个文件中。该文件是使用上述 Apple API 创建的。
用 C# 读取 Apple 数据的最简单方法是什么?
谢谢,Marcel
is there a C#/.NET library or otherwise existing code that can read persisted data from Apple's serialization API, namely NSKeyedArchiver, NSKeyedUnarchiver, NSCoder
?
Context: A friend of mine created a cool app for some of the Apple devices. I have a similar app for the Microsoft world and want to import his documents. The data is in a single file containing all necessary content. This file is created with the above mentioned Apple API.
What is the most simple way of reading Apple's data in C#?
Thanks, Marcel
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果跨平台阅读是您的目标,在我看来,您应该使用跨平台序列化器。 Xml 将是一个简单的示例(并检查文档,可能受支持),所以第一个我尝试的是将序列化为 xml 并破解生成的内容。
如果这不起作用,或者您需要更紧凑的东西,则可以使用 protobuf Objective-C< /a> (或其他,当然还有几个用于 C#)。
我对 Apple 序列化 API 不太了解,但是平台绑定序列化程序往往会做一些使可移植性变得非常困难的事情:
If cross-platform reading is your goal, IMO you should use a cross-platform serializer. Xml would be a trivial example (and checking the docs, may be supported), so the first thing I'd try is serializing as xml and hacking through what is generated.
If that doesn't work, or you need something more compact then protobuf is available for Objective-C (or another, and of course there are several for C#).
I don't know much about the Apple serialization API, but platform tied serializers tend to do a few things that make portability very hard: