0

I am trying to pass a model object to a local server that i created. The model object is a cpp class. I need to convert it into data so that i could write it over the stream. When i tried to archive the class using Coder methods, gave me an error.

Is there any better ways to do this? Any help or insight on this, is appreciated.

Thank you...

Nibin V
  • 474
  • 6
  • 24

1 Answers1

0

Did you try +dataWithBytes:length:?

StilesCrisis
  • 15,972
  • 4
  • 39
  • 62
  • Hi @StilesCrisis Thanks. Yes i did. Now I could convert it into NSdata. But when i tried to access the variables after converting it back to the cpp model object, it resulted in wrong values. – Nibin V Aug 07 '12 at 05:18
  • I think serialization of cpp model object is not directly possible in xcode. So i wrote all the variables in the model object to a file and transfered the data from that file to the server. Now its working perfectly as i wanted. Thanks anyway.. :) – Nibin V Aug 09 '12 at 09:16