在应用程序中,我正在使用蓝牙低功耗 (BLE) 使用两个不同的 iOS 设备创建一个带有“远程控制”的视频播放器,其中一个设备是视频播放器,另一个是发送消息以播放、暂停、倒带等. 在这里,我使用 CBCentralManagerOptionShowPowerAlertKey 创建了中央管理器。
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], CBCentralManagerOptionShowPowerAlertKey, nil];
centralManager = [[CBCentralManager alloc]initWithDelegate:self queue:nil options:options];
如果设备没有打开其蓝牙设置(我得到的那个有粗体),则会弹出一个类似于这个的警报视图/警报控制器。
CLBeaconRegion,如何关闭警告:打开蓝牙允许*连接到附件
我想在按下除 resignFirstResponder 之外的 OK 按钮时添加更多功能。
我缺少什么需要修改此警报视图/警报控制器中的 OK 按钮的功能?我已经断点并记录了方法,但仍然未能捕捉到:
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
{
NSLog(@"Button Index =%ld",(long)buttonIndex);
}
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
NSLog(@"%ld", (long)buttonIndex);
}
-(void)alertViewCancel:(UIAlertView *)alertView
{
NSLog(@"alert view cancel");
}