You have to initially wait until the centralManager gets the callback from centralManagerDidUpdateState:
when you're app boots up. Then every other time, I recommend checking the state prior to doing any centralManager calls. You're most likely calling scan or retrieve before the central has had a chance to update. Ensure you only call methods after you know it's on. You will not get the error if you wrap each call in if statements that check the state first.
- (void)centralManagerDidUpdateState:(CBCentralManager *)central
{
if(central.state==CBCentralManagerStatePoweredOn)
{
//Now do your scanning and retrievals
}
}
Otherwise just wrap your central inside a state check before each call:
if(yourCentral.state==CBCentralManagerStatePoweredOn)
{
//you're good to go on calling centralManager methods
}