在 iOS 7 中,一些核心蓝牙的东西现在被弃用了,比如 CBUUIDGenericAccessProfileString 和 CBUUIDDeviceNameString。苹果文档状态
"(Deprecated. There are no replacements for these constants.)"
我想知道我们应该做些什么来替换这些 GAP 东西,因为苹果文档和示例没有帮助。整个互联网似乎也对此保持沉默。我的代码很像Heart Rate Monitor 示例,它仍然有已弃用的代码
/* GAP (Generic Access Profile) for Device Name */
if ( [aService.UUID isEqual:[CBUUID UUIDWithString:CBUUIDGenericAccessProfileString]] )
{
[aPeripheral discoverCharacteristics:nil forService:aService];
}