To exchange data using the iPhone SDK, you must use the GameKit Framework .
You can see this sample code or this code sample from a live application in the app store or the code mentioned by Randolph, here .
The main process is setting up the controller and delegate to work with the Bluetooth connection for you. Your delegate should handle things like "Connected to a peer-to-peer network" or "Received data."
In addition, you should note that the simulator does not work with Bluetooth, so you need two real iOS devices or more for testing.
source
share