Ios 核心蓝牙读/写数据

Ios 核心蓝牙读/写数据,ios,nsdata,core-bluetooth,cbperipheral,lgbluetooth,Ios,Nsdata,Core Bluetooth,Cbperipheral,Lgbluetooth,我正在与iOS central合作,以便与BLE外围设备进行通信 使用蓝牙框架 该方法得到 [LGUtils readDataFromCharactUUID:aCharactId seriveUUID:aServiceId peripheral:peripheral completion:^(NSData *data,

我正在与iOS central合作,以便与BLE外围设备进行通信

使用蓝牙框架

该方法得到

[LGUtils readDataFromCharactUUID:aCharactId seriveUUID:aServiceId peripheral:peripheral completion:^(NSData *data, NSError *error) { NSLog(@"Data : %s Error : %@", (char *)[data bytes], error); }]; [LGUtils ReadDataFromCharacterUID:aCharactId seriveuid:aServiceId 外围设备:外围设备 完成:^(NSData*数据,NSError*错误){ NSLog(@“数据:%s错误:%@,(字符*)[数据字节],错误); }]; 它输出“1234567890”

我需要将(char*)[data bytes]转换为NSInteger。 当我得到它的时候

NSInteger dataInt = [data bytes]; NSInteger dataInt=[数据字节];
我得到了2013527536,但外围端的值是1234567890

NSInteger dataInt = atoi((const char*)[data bytes]);

我使用了atol((const char*)[data bytes])上面的链接不起作用