Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

multinode

macrumors regular
Original poster
Feb 4, 2011
150
0
I have an array of arrays (an NSArray which contains NSArray objects) that live in a server in my MBP. I need to serialize and then stream this object to an iPad client that's connected to this server and then reconstruct the object on the client.

I know how to archive this object and if I wanted to write the archive to a file I know how to do that. But my issues are different.

.............

My output stream can use a write method:
Code:
 write:maxLength:
that writes maxLength bytes from a buffer. My input stream on the receiving end (client) can use a read method:
Code:
read:maxLength:
that reads maxLength bytes into a buffer. So my two problems are: how should I load the outgoing buffer from the archive of the original NSArray AND how should I unload the receiving buffer into an archive on the client?

I do know how to go from an NSArray to an archive and how to go from an archive back to an NSArray.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.