I have a property with name bgImage in my custom UITableViewCell class (MyTableCell). Its declared like
@property (nonatomic, retain) UIImageView *bgImage;
in dealloc method of MyTableCell, i release btImage
[bgImage release];
self.bgImage = nil;
[super dealloc];
Now what I do with this bgImage in cellForRowAtIndexPath is that i assign it a autoreleased object
myTableCell.bgImage.image = [Util imageNamedNoCache:@"image.png"];
where imageNamedNoCache returns an autoreleased image.
My problem is that I get EXC_BAD_ACCESS in dealloc method of MyTableCell.
Can anyone please tell me why I am getting this?
Best Regards
You release
bgImagetwice in dealloc, that’s why you getEXC_BAD_ACCESS.You release it yourself and it is released in generated setter method when you do
self.bgImage = nil;