Do we need to release an UIImage object even not allocated memory?
- by Madan Mohan
Hi Guys,
I added an image to button
UIImage* deleteImage = [UIImage imageNamed:@"Delete.png"];
CGRect imageFrame=CGRectMake(-4,-4, 310, 55);
[btn setFrame:imageFrame];
btn.backgroundColor=[UIColor clearColor];
[btn setBackgroundImage:deleteImage forState:UIControlStateNormal];
[btn setTitle:@"Delete" forState:UIControlStateNormal];
[btn addTarget:self action:@selector(editDeleteAction) forControlEvents:UIControlEventTouchUpInside];
[elementView addSubview:btn];
[deleteImage release];// do we need to release the image here
If I release here its working fine but in object allocations no.of image count is increasing.