I create multiplayer game.
I used this tutorial for create my game:
My issues now is: – how to shared data for all players.
In tutorial Ray Wenderlich we can send data with struct. We send struct and we have ability get the simple data (for example int value or other). How to send data without struct?
Thanks for response!
NSObjects are pointers, so if you try and send it you will just send the pointer rather than the object. My suggestion is that you implement a -serialize method for your subclass, which
converts your object to either a string or to numbers. Then implement a -deserialize method to do the reverse. I can’t help you with the nature of these methods, as I do not know what your NSObject contains, but only send the bare minimum of data.
Sidenote: Why can’t you use structs?