“Variable ‘xxx’ was never mutated; consider changing to ‘let’ constant” ERROR

You just need to remove var, making your code:

for characteristic in service.characteristics ?? [] {
    print(str)
    _selectedPeripheral!.writeValue(str.dataUsingEncoding(NSUTF8StringEncoding)!, forCharacteristic: characteristic, type: CBCharacteristicWriteType.WithoutResponse)
}

because characteristic is immutable by default.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)