0

I need to exchange an object between Objective-C client and Java Server. I ask my friends how it can implement, and he answer me that read byte is the way to go. But how can it implements? How can I know the variable length, and related information? Thanks.

1
  • It's relatively meaningless to say "exchange objects" between Java and Objective-C without specifying some sort of extra-linguistic object concept. Commented Apr 20, 2012 at 16:13

3 Answers 3

1

You need some sort of serialization format. You could use a text-based format such as XML or JSON, decoding it appropriately (whether by hand or not). Alternatively, there are various portable binary-based serialization formats available, such as Protocol Buffers which has an Objective-C port.

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

Comments

1

Objects in different language probably can't be exchanged easily. Instead of sending Java/ObjC objects to Java/ObjC program, I will suggest you to actually send it as some other string structure - maybe XML/JSON. And then reconstruct back the Java/ObjC objects from the XML/JSON.

Comments

-1

There are a lot of options here. JSON, protocol buffers, ... There's even a giant list of possibilities.

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.