I've been repeatedly getting the following error when compiling my project:
Unknown class name 'CBCentralManagerDelegate'; did you mean 'CBCentralManager'
Within CoreBluetooth.framework my CoreBluetooth.h is as follows:
/*!
* @header
* @file CoreBluetooth.h
* @framework CoreBluetooth
*
* @discussion Bluetooth Low Energy framework
*
* @copyright 2011 Apple, Inc. All rights reserved.
*/
#ifndef _CORE_BLUETOOTH_H_
#define _CORE_BLUETOOTH_H_
#endif
#import <CoreBluetooth/CBDefines.h>
#if __OBJC__
#import <CoreBluetooth/CBCentralManager.h>
#import <CoreBluetooth/CBPeripheralManager.h>
#import <CoreBluetooth/CBPeripheral.h>
#import <CoreBluetooth/CBCentral.h>
#import <CoreBluetooth/CBService.h>
#import <CoreBluetooth/CBCharacteristic.h>
#import <CoreBluetooth/CBDescriptor.h>
#import <CoreBluetooth/CBError.h>
#import <CoreBluetooth/CBUUID.h>
#import <CoreBluetooth/CBAdvertisementData.h>
#import <CoreBluetooth/CBATTRequest.h>
#endif
Specifically I'm missing #import <CoreBluetooth/CBCentralManagerDelegate.h>
as well as the relevant class within my Headers folder. Does anyone know why this might be the case? I'm using Xcode 15.1 Beta 3.
The error message says Unknown class name
but CBCentralManagerDelegate
is a protocol. Is your code trying to use it in a context where a class name is expected?
Or if this doesn’t help, can you post a small snippet of your app code that triggers the error?
Also note that CBCentralManagerDelegate
is declared in CBCentralManager.h
rather than in its own file.