有没有办法取消未来一段时间内安排的dispatch_after(),到目前为止还没有解雇?我正在尝试为服务器更新调度程序,这个方法就像我想要的那样,但是,我希望在某些时候取消并重新安排它.是否有可能或我必须回退并使用NSTimer?
此代码允许确定当前的蓝牙状态:
CBCentralManager* testBluetooth = [[CBCentralManager alloc] initWithDelegate:nil queue: nil];
switch ([testBluetooth state]) {....}
Run Code Online (Sandbox Code Playgroud)
但是,当[[CBCentralManager alloc] init ...]发生时,如果蓝牙关闭,系统会向用户弹出警报.
有没有办法检查蓝牙状态而不打扰我的用户?