iPhone Bluetooth Objective - C Programming
Using Xcode, create a new View-based Application project and name it as Bluetooth. All the various APIs for accessing the Bluetooth is located in the GameKit framework. Hence, you need to add this framework to your project. Add a new Framework to the project by right-clicking on the Frameworks group in Xcode and selecting Add, Existing Frameworks. Select GameKit.framework In the BluetoothViewController.h file, declare the following object, outlets, and actions: #import #import @interface BluetoothViewController : UIViewController { GKSession *currentSession; IBOutlet UITextField *txtMessage; IBOutlet UIButton *connect; IBOutlet UIButton *disconnect; } @property (nonatomic, retain) GKSession *currentSession; @property (nonatomic, retain) UITextField *txtMessage; @property (nonatomic, retain) UIButton *connect; @property (nonatomic, retain) UIButton *disconnect; -(IBAction) btnSend:(id) sender; -(IBAction) btnConnect:(id) se...