This code should be rewritten to use MemoryBlock.Ptr -- 

retArray.append new NSColor((m.Ptr(i*SizeOfPointer))