The way to load image to the layer is simply this:
CALayer *layer = [[CALayer alloc]init];
layer.contents = (id) [UIImage imageNamed:@"image.png"].CGImage;
then you add the layer as sublayer to the view something like:
assume you in the view
[self.layer addSublayer:layer];
Now I want to load an array of image as animation so eventually I will get the images animated.
so before actually perform the animation I have tested the following:
[values insertObject:(id)[UIImage imageNamed:path].CGImage atIndex:i];
of course there is a loop that that runs that enter each image to the right index... and then I am getting an array of CGImage
.. for the animation.
I have printed this array and saw this:
CGImage 0x17d900
CGImage 0x17f4e0
So the values are there.. and I am not getting any errors .. but I do not see the images...
Let me know if you have an idea ....