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

libGdx unable to find files in android application data directory -

php - Webix Data Loading from Laravel Link -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -