- (void) rgbMatrix:(UIImage *)i toRGB:(uint32_t **)rgbArray{
int m_width = i.size.width;
int m_height = i.size.height;
*rgbArray = (uint32_t *) malloc(m_width * m_height * sizeof(uint32_t));
}
uint32_t *rgbArray = NULL;
[self rgbMatrix:image toRGB:&rgbArray];
someone can help?this doesn’t work.is that way using malloc not support in objective-c?
guys.Problem solved.there is nothing wrong with that code above. i made a stupid mistake, wrong assignment such like : rgbArray[count] = 255; which should be *rgbArray[count] = 255;…and this change the array pointer’s address..
I am so sorry i did not post the complete code..and thx all you guys.