bufferPtr=malloc(bufferPtrSize * sizeof(uint8_t))
assigning to 'uint8_t *' (aka 'unsigned char *' ) from incompatible type 'void *'
This is because
.mm files aren't treated as normal Objective-C files but as Objective-C++ files, so the type rules of C++ apply here. In C++, if you decide to have a type (in this case you have a void pointer) and then want another type (in your case a char pointer), then you have to explicitly cast them. The way to do this is
T is the target type. Ie:
uint8_t *bufferPtr = static_cast<uint8_t *>(malloc(bufferPtrSize * sizeof(uint8_t)));