1

我在我的项目中使用核心蓝牙LE_POWER_OFF_HEADER并且一切正常,但是当我的设备上的蓝牙被禁用时,我会收到一条带有文本以及“设置”和“取消”按钮的警报。我想更改文本和语言。

这似乎是一个默认警报,我无法更改它。

警报只是在中央状态为 时弹出poweredOff。我使用这个函数来检查 Central Manager 的状态:

- (void)centralManagerDidUpdateState:(CBCentralManager *)central{ 
NSString *messtoshow;

switch (central.state) {
    case CBCentralManagerStateUnknown:
    {
        messtoshow=[NSString stringWithFormat:@"State unknown, update imminent."];
        break;
    }
    case CBCentralManagerStateResetting:
    {
        messtoshow=[NSString stringWithFormat:@"The connection with the system service was momentarily lost, update imminent."];
        break;
         }
    case CBCentralManagerStateUnsupported:
         {
        messtoshow=[NSString stringWithFormat:@"The platform doesn't support Bluetooth Low Energy"];
        break;
         }
    case CBCentralManagerStateUnauthorized:
         {
        messtoshow=[NSString stringWithFormat:@"The app is not authorized to use Bluetooth Low Energy"];
        break;
         }
    case CBCentralManagerStatePoweredOff:
         {
        messtoshow=[NSString stringWithFormat:@"Bluetooth is currently powered off."];
        break;
         }
    case CBCentralManagerStatePoweredOn:
         {
        messtoshow=[NSString stringWithFormat:@"Bluetooth is currently powered on and available to use."];
        [mgr scanForPeripheralsWithServices:[NSArray arrayWithObject:[CBUUID UUIDWithString:@"180D"]] options:nil];
        [mgr retrieveConnectedPeripherals];

        //--- it works, I Do get in this area!

        break;
    }   

}
NSLog(messtoshow); }
4

1 回答 1

1

尝试使用设备,您将获得本地化语言的正确消息。

于 2013-05-15T12:46:32.890 回答