Do we need to release an UIImage object even not allocated memory?
Posted
by Madan Mohan
on Stack Overflow
See other posts from Stack Overflow
or by Madan Mohan
Published on 2010-03-26T09:04:03Z
Indexed on
2010/03/26
9:13 UTC
Read the original article
Hit count: 178
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.
© Stack Overflow or respective owner