If you have a C pointer which was defined in a method and are trying to return it from an object method in Objective C, what do you place as the return object type for the method?
For example, I am using code that converts a UIImage into an RGBA image map (as seen here) – but the code stores a C pointer to the memory that is unclear how to return.
- (??what goes here??) returnTextureRGB
{
// ... other code ...
void *imageData = malloc(height*width *r);
// ... other code ...
return(imageData);
}
What is the correct object type to declare being returned?
I don’t know why is this related to C#, however Objective-C is a superset of C, thus every C syntax is also a valid Objective-C syntax.
Just place
void*as return type.