In the latest Apple docs, the UUID property of a CBCharacteristic has a line drawn through it, and the notation that it is available only in 5.0 through 7.1. But the word "deprecated", which you usually expect to see, is nowhere in sight.
More to the point, there is no suggestion of how else we can identify a characteristic, e.g. when we are passed one in the delegate method peripheral:didUpdateValueForCharacteristic:. In that method, it is critical to decide which characteristic I am dealing with. The descriptors member of the CBCharacteristic instance is nil. What else is there? How does Apple intend for us to distinguish between characteristics? The whole point of UUIDs is identification...
Looking at the header for CBCharacteristic sheds some light on this. There is no more UUID property in the class, but CBCharacteristic is now a subclass of CBAttribute, which does have the UUID property. And this (new) parent class is marked as being available starting in iOS 8.
This can explain why the UUID member has a strikethrough, but no "deprecated" warning: you can still get the UUID, but it is inherited rather than belonging to CBAttribute directly.
UUID turned into an inherited attribute from iOS8
Here is the evidence from Apple's document
CoreBluetooth Changes in IOS8 API diffs
Added CBAttribute
Added CBAttribute.UUID
Removed CBCharacteristic.UUID
Modified CBCharacteristic
Superclasses:
From NSObject
To CBAttribute
And many other basic CoreBluetooth classes(who contains UUID) adopts this change
However, class reference of CBCharacteristic still says it inherits from NSObject.
So it is misguiding and developers can easily understand UUID as a deprecated attribute in iOS8
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With