I've the code in Java where p1 is an object of Pixel class which accesses an array pixels and assigns it the value (at right side) at the proper index. R G and B are some int values.
p1.pixels[index] = 0xff000000 | (R << 16) | (G << 8 ) | B;
I'm converting this code in Objective C as follows.But I don't know whether I have to mention the object name (insert object at p1.pixels) or inserting object at pixels does the same?
int newNumber = 0xff000000 | (R << 16) | (G << 8 ) | B;
NSNumber *yourNumber = [NSNumber numberWithInt:newNumber];
[pixels insertObject:yourNumber atIndex:index];