应用程序打开后,按“打开设备”。
centralManagerDidUpdateState函数正在运行。
CBUUID *uuid = [CBUUID UUIDWithString:@"8A1FEA41-3A2F-7860-568D-2325D6C31C91"];
NSArray *services = [NSArray arrayWithObjects:uuid, nil];
NSDictionary *options = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:CBCentralManagerScanOptionAllowDuplicatesKey];
[central scanForPeripheralsWithServices:services options:options];
不会调用didDiscoverPeripheral:function。
-(void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI{
}
但是如果调用nill值为scanForPeripheralsWithServices,则会调用didDiscoverPeripheral:function。
[central scanForPeripheralsWithServices:nil options:options];
什么是问题?请。