I am trying out Core Bluetooth framework introduced in iOS 5.0. According to many threads (one of many) on StackOverflow itself:
Well, my understanding of Bluetooth Low Energy (BLE) general was poor. As the accepted answer pointed out, one device has to act as Central and other one has to act as peripheral for communication to take place.
A good example source code for iOS to iOS and iOS to Mac OS BLE communication is here.
Some important points to consider
Well some information..
As spamsink commented, one device needs to act as peripheral, and one as central in order for them to communicate.
There is a great sample app from Apple that does that. Also, check out WWDC 2012 sessions 703 - CoreBluetooth 101 and 705 - Advanced CoreBluetooth for great explanation and examples of CoreBluetooth framework usage.
Also note, for device to be in peripheral mode, it needs to be updated to iOS 6.0 or later.
if you call scanForPeripherals function in didUpdateState delegate then it works because delegate functions can't return.