Hello, I'm creating a wrapper for an image processing library.
Some of the properties return (void *) data type.
My question is how can I return this data from a wrapper so that I can send it as a parameter to the Objective C methods from B4I.
I wrapped the void pointer with NSData. And then wrapped it with B4IArray. But when I am trying to get the buffer in the ObjC code like b4iarray.bytesData.bytes that is showing a broken image.
Is there any specific way to wrap the void pointer in B4I or not? If not then how to access this type of data?
Some of the properties return (void *) data type.
My question is how can I return this data from a wrapper so that I can send it as a parameter to the Objective C methods from B4I.
I wrapped the void pointer with NSData. And then wrapped it with B4IArray. But when I am trying to get the buffer in the ObjC code like b4iarray.bytesData.bytes that is showing a broken image.
Objective-C:
- (B4IArray*)data{
NSData* data = [NSData dataWithBytes:[buff data] length:[buff size]];
B4IArray* arr = [B4IArray new];
arr = [arr initBytesWithData:[NSKeyedUnarchiver unarchiveObjectWithData:data]];
return arr;
}
Is there any specific way to wrap the void pointer in B4I or not? If not then how to access this type of data?
Last edited: