objective c - Passing NSData Multiplayer GAme -


i want pass array 1 player player:

this how create it:

nsdata *packet = [nsdata datawithbytes:&_spielescreenshots length:sizeof(_spielescreenshots)]; 

nsdata. _spielescreenshots array.

how can array in didreceivedata method? possible?

(void)match:(gkmatch *)match didreceivedata:(nsdata *)data fromplayer:(nsstring *)playerid {} 

i use create data:

nsdata* data = [nskeyedarchiver archiveddatawithrootobject: self.spielescreenshots];

and in didrecievedata method: nsmutablearray *array = [nskeyedunarchiver unarchiveobjectwithdata:data];

now error:

* terminating app due uncaught exception 'nsinvalidargumentexception', reason: '* -[nskeyedunarchiver initforreadingwithdata:]:


Comments

Popular posts from this blog

javascript - Feed FileReader from server side files -

c++ - What's the differece between of link to a dynamic file and as a input object? -

Android Unit Testing / Mockito: android.location.Location not mocked -