2014-07-09 2 views
0

최근에 휴대 전화를 iOS 베타 버전 8로 업그레이드하고 내 iOS 앱을 설치했습니다. 불행히도 내 앱은 내 주변 기기 인 BLE 기기를 더 이상 검색 할 수 없습니다. 나는 어떤 변화가 있었지만 아무 것도 발견하지 못했다고 말하는 어떤 문서를 조사했다. iOS 8의 일부로 도입 된 알려진 API 변경 사항이 있습니까? 나는 아이폰 5S에 테스트입니다 내 코드 IOS 버전에 이전 코드의 7.xx주변기기 Bluetooth 저에너지 기기를 찾을 수 없습니다.

관련 부분 일하고 :

[self.CM scanForPeripheralsWithServices:nil options:nil]; 

답변

1

당신이 검사를 시작됩니다?

-(void)centralManagerDidUpdateState:(CBCentralManager *)central{ switch (central.state) { 
    case CBCentralManagerStatePoweredOff: 
     NSLog(@"CoreBluetooth BLE hardware is powered off"); 
     break; 
    case CBCentralManagerStatePoweredOn: 
    { 
     NSLog(@"CoreBluetooth BLE hardware is powered on and ready"); 
     [self.CM scanForPeripheralsWithServices:nil options:nil]; 
    } 
     break; 
    case CBCentralManagerStateResetting: 
     NSLog(@"CoreBluetooth BLE hardware is resetting"); 
     break; 
    case CBCentralManagerStateUnauthorized: 
     NSLog(@"CoreBluetooth BLE state is unauthorized"); 
     break; 
    case CBCentralManagerStateUnknown: 
     NSLog(@"CoreBluetooth BLE state is unknown"); 
     break; 
    case CBCentralManagerStateUnsupported: 
     NSLog(@"CoreBluetooth BLE hardware is unsupported on this platform"); 
     break; 
    default: 
     break; } 
+0

참조이 대답 : HTTP : /를 centralmanager 상태에있는 경우에만 당신은 주변 장치를 검색 한 다음의 viewDidLoad에

self.CM = [[CBCentralManager alloc] initWithDelegate:self queue:nil]; 

전화를 걸거나 다른 곳에서는 당신이 그에게 필요하고해야 /stackoverflow.com/questions/25389358/ios8-and-btle-cbcentralmanager-unable-to-find-peripherals –

관련 문제