jonas
jonas

Reputation: 143

Encode/decode NSCoder data in C++

I'd like to send serialized objects between a C++ application (running on a linux machine) and an iPhone application. Is this possible?

Is there a way to encode/decode data using the NSCoding protocol on the C++ side? Has someone reverse engineered this protocol?

Upvotes: 2

Views: 871

Answers (2)

jonas
jonas

Reputation: 143

I couldn't find any techniques to decode objects in C++ that had been serialized using the NSCoder protocol.

I ended up building a JSON interface on both sides and simply sending my objects back and forth as serialized text.

Thanks for the responses and ideas!

Upvotes: 2

acjay
acjay

Reputation: 36571

I'm no expert, but it seems like your best bet is to use property lists, which allow you to serialize objects into a device-independent format. You may still need to write some custom deserialization code on the C++ side, however. But this seems easier than trying to decode archived objects.

Check this out for more details: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Archiving/Articles/serializations.html#//apple_ref/doc/uid/20000947-BCIEBEGI

Upvotes: 0

Related Questions