2

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?

3
  • NSCoding is just an Objective-C protocol. Did you mean NSKeyedArchiver and NSKeyedUnarchiver? Not sure but I think those are included in GNUstep which you can use with Objective-C++ (a superset of C++ similar to Objective-C). Commented Sep 6, 2011 at 21:34
  • Also, files archived with NSKeyedArchiver are just binary property lists. You can examine them with Property List Editor or Xcode. Commented Sep 6, 2011 at 21:36
  • Yes, what I'd like is a C++ equivalent of NSKeyedArchiver/NSKeyedUnarchiver. Does this exist? Commented Sep 6, 2011 at 21:42

2 Answers 2

2

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!

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.