---- MyEventSelectorCell.hUIImageView EXC_BAD_ACCESS
@interface MyEventSelectorCell : UITableViewCell {
IBOutlet UIImageView* eventImage;
}
@property(nonatomic, retain) IBOutlet UIImageView* anImage;
----- MyEventSelectorCell.m
-(id) dealloc {
[anImage release];// < -- If I comment this out, It starts leaking, but program runs fine...
}
---- MyTableViewController.h
@MyTableViewController: UIViewController<UITableViewDelegate> {
IBOutlet MyEventSelectorCell* tmpCell;
}
@property(nonatomic, retain) IBOutlet MyEventSelectorCell* tmpCell;
- - MyTableViewController.m
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
...
[[NSBundle mainBundle] loadNibNamed:@"MyEventSelectorCell" owner:self options:nil];
tmpCell.anImage.image = [UIImage imageNamed: @"someimage.png"];
...
}
EXC_BAD_ACCESS arrive après que je libère ANIMAGE lors de la mise la propriété du UIImageView à imageNamed ci-dessus ...
Vous devez ajouter [super dealloc] à la fin de votre dealloc. Normalement, dealloc renvoie un vide; vous avez déclaré retourner l'identifiant mais ne l'avez pas renvoyé. Votre compilateur lance toutes sortes d'avertissements que vous ignorez. – Giao