Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/106.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 未调用CentralManagerDipDateState委托_C++_Ios_Objective C_Bluetooth_Communication - Fatal编程技术网

C++ 未调用CentralManagerDipDateState委托

C++ 未调用CentralManagerDipDateState委托,c++,ios,objective-c,bluetooth,communication,C++,Ios,Objective C,Bluetooth,Communication,我正在使用CoreBooth框架在MAC上进行蓝牙通信 使用纯Objective C,代码运行良好 我想从cpp调用Objective c代码,我正在使用一个包装器函数来实现这一点,然后初始化centralManager。但未调用CentralManager RDIDUPDATESTATE委托(即中央管理器未通电) 在处理cpp班的目标c学员时,是否需要注意一些事项 我是新的目标c编码。任何关于这方面的意见都会很有帮助 代码: CInterface.h-> void wrapperFunct

我正在使用CoreBooth框架在MAC上进行蓝牙通信

使用纯Objective C,代码运行良好

我想从cpp调用Objective c代码,我正在使用一个包装器函数来实现这一点,然后初始化centralManager。但未调用CentralManager RDIDUPDATESTATE委托(即中央管理器未通电)

在处理cpp班的目标c学员时,是否需要注意一些事项

我是新的目标c编码。任何关于这方面的意见都会很有帮助

代码:

CInterface.h->

  void wrapperFunction();
main.cpp->

#include <CInterface.h>
int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    wrapperFunction();
    return a.exec();
}
#包括
int main(int argc,char*argv[])
{
qcorea应用程序(argc、argv);
包装器函数();
返回a.exec();
}
MyDelegateObject.h->

#include <CInterface.h>
#include <IOBluetooth/IOBluetooth.h>

@interface MyDelegateObject : NSObject <CBCentralManagerDelegate> {

}

- (void) centralManagerDidUpdateState:(CBCentralManager *)central;
@end
#包括
#包括
@接口MyDelegateObject:NSObject{
}
-(无效)中央管理者数据状态:(CBCentralManager*)中央;
@结束
MyDelegateObject.mm->

@implementation MyDelegateObject

void wrapperFunction(){
    qDebug()<<"Inside Wrapper function";
    MyDelegateObject *myDelegate = [MyDelegateObject alloc];
    CBCentralManager *myCentralManager = [[CBCentralManager alloc] initWithDelegate:myDelegate queue:nil]; 
}

- (void) centralManagerDidUpdateState:(CBCentralManager *)central
{
    qDebug()<<"inside delegate";
}
@实现MyDelegateObject
void wrapperFunction(){

qDebug()你能提供代码吗?请注意:我在mac上使用QT,并使用IOBluetooth框架。