I'm trying to use
[currentSession sendDataToAllPeers:data withDataMode:GKSendDataReliable error:nil];
to send an NSDictionary (or a plist file) containing data from 1 device to another, and
- (void)receiveData:(NSData *)data fromPeer:(NSString *)peer inSession:(GKSession *)session context:(void *)context
to receive it. How can I convert to and from NSData for this to happen?
You can use the following to transform Plist to NSData:
And this to transform NSData to Plist:
of
NSPropertyListSerialization
classformat
could beNSPropertyListBinaryFormat_v1_0
to use lowest byte count