*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present modally an active controller <HKConnectViewController: 0x1050158e0>.'
分析:
很有可能是你的觸發事件中,觸發了多次。也就是說:不止一次調用了present。
解決辦法:
保證只執行一次
static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ [self presentViewController:self.bluetoothCloseAlertC animated:YES completion:nil]; });