开发者

Reading persisted data from Apple/Objective-C in C#/.NET

is there a C#/.NET library or otherwise existing code that can read persisted data from Apple's se开发者_StackOverflow中文版rialization 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


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:

  • undocumented format (often)
  • tied to platform-specific types, requiring re-mapping
  • tied to specific names (fields etc) or layouts (byte offset) on the types
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜