現在、arduino の LTE Bluetooth モジュールが Iphone にメッセージを送信するプロジェクトに取り組んでいます。CBCentralマネージャーのAppleドキュメントを読んでiPhoneアプリを開始し、このコードを思いついた
-(instancetype)init{
self = [super init];
if(self){
self.bluetoothManager = [[CBCentralManager alloc] initWithDelegate:self queue:nil options:nil];
}
return self;
}
-(instancetype)initWithDelegate:(id<BLEDelegate>)delegate{
self = [self init];
self.delegate = delegate;
return self;
}
- (void)centralManagerDidUpdateState:(CBCentralManager *)central
{
NSLog(@"called");
}
CBCentralManager をインスタンス化し、delegate と self を設定してアプリを起動すると、centralManagerDidUpdateState が呼び出されません。