advertisementData包含:
Advertisement data {
kCBAdvDataIsConnectable = 1;
kCBAdvDataLocalName = "Ali \n";
kCBAdvDataServiceUUIDs = (
"43200-B827-EB74-0E24-192168001107"
);
}
if(advertisementData[@"kCBAdvDataServiceUUIDs"] hasPrefix:@"432"){
NSLog("It contains this string");
}
当我执行代码时,它给了我错误: 因未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:' - [CBUUID hasPrefix:]:无法识别的选择器发送到实例0x170034260'。
答案 0 :(得分:2)
kCBAdvDataServiceUUIDs是CBUUID
。使用uuidString
获取字符串。