November 2013
Intermediate to advanced
576 pages
19h 3m
English
The previous examples are really the simplest form of receiving data. Most of the time, you need to convert the NSData back into whatever format you want to work with, such as an NSString or a UIImage. In addition, you will probably want to do something with that newly received data beyond logging it. Take a look at the receiveData:fromPeer:inSession:context: method in the sample app, shown in the following code snippet. Because the sample app is working with a string, the first thing that needs to be done is retrieve the value back out of the NSData. After you have the NSString, you need to store it into the expected data format of an NSDictionary. This is the same approach taken in the sending data methods, ...
Read now
Unlock full access