I have 4 UIViews each view contains around 16 UIImageViews. And i am applying mask to all the UIImageViews through below code
-(void)setMask:(UIImage*)maskImage forImageView:(UIImageView*)imageView
{
CALayer *mask = [[[CALayer alloc] init] autorelease];
mask.contents = (id)[maskImage CGImage];
mask.frame = CGRectMake(0, 0, 1024, 768);
imageView.layer.mask = mask;
imageView.layer.masksToBounds = YES;
return;
}
Is this right code for UIImageView masking ?
Each UIImageView is changes image through mask. But after changing images in more than 5 UIImageView "Receive memory warning." appears and it crashes. All the images are in 1024*768 resolutions , even mask images too.