Hemang Hemang - 7 months ago 48
iOS Question

How to get exact value from a CBCharacteristic?

<CBCharacteristic: 0x156d48cf0, UUID = BLevel, properties = 0x18, value = <32353732 380d0a>, notifying = YES>

I want to extract what's there in value field.

NSData *data = c.value; // c is of type CBCharacteristic

But I don't know which kind of value it is?


You can convert the NSData to an NSString using

NSString *str = [[NSString alloc] initWithData:c.value encoding:NSUTF8StringEncoding];