Hemang Hemang - 1 year ago 84
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?

Answer Source

You can convert the NSData to an NSString using

NSString *str = [[NSString alloc] initWithData:c.value encoding:NSUTF8StringEncoding];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download