StructureToPtr() can not use class?

this code is work

BUT change struct to class

not work in ipad (no error in another platform)

error message is

how can I change class object to ByteArray?

I need to communicate to C++ server use TCP

unity 3.0 b7

Hi,
according to Mono developers: “the aot compiler doesn’t know that the user will call StructureToPtr, it can’t infer it, so we generate structure-to-ptr wrappers for all structures which are supported by StructureToPtr i.e. doesn’t have reference fields etc. But we don’t do the same for classes. We could generate wrappers for classes too, but that would lead to some major blow up in code size”.
I hope this will help you to find a solution.

Hi!
I also have the same problem and have been working for over 3 days.
Could you tell me how to solve it?
Please help me.

Regards.