2011-08-19 5 views
0

Je charge ma vue de xib. Et quand essayer de libérer, il se bloque avec le message:L'application se bloque sur Dealloc

Project Designer (72849,0xa08c0540) malloc: * erreur pour objet 0x4b06000: pointeur étant libéré n'a pas été alloué * mis un point d'arrêt dans malloc_error_break de débogage actuel langue: auto; actuellement c objectif

Voici mon implémentation:

@interface ACLine : UIView { 

    NSMutableArray *chevrons; 
} 

- (void)addChevron:(ACChevron *)aChevron; 
- (void)addChevron:(ACChevron *)aChevron atIndex:(NSInteger)anIndex; 

- (void)removeAllChevrons; 
- (void)removeChevron:(ACChevron *)aChevron; 
- (void)removeChevronAtIndex:(NSInteger)anIndex; 

- (void)update; 

@property (nonatomic, retain) NSMutableArray *chevrons; 

@end 

@implementation ACLine 

@synthesize chevrons; 

- (void)awakeFromNib { 

    chevrons = [[NSMutableArray alloc] init]; 
} 

- (void)dealloc { 
    self.chevrons = nil; 
    [super dealloc]; it crashes here 
} 

S'il vous plaît aider à résoudre le problème. Merci.

Répondre

0

Essayez les chevrons à libération automatique.

chevrons = [[[NSMutableArray alloc] init] autorelease]; 

Espérons que cela puisse aider.

0

Avez-vous essayé d'ajouter "[super awakeFromNib];" après "- (void) awakeFromNib {"?

+0

Oui, le même problème – Sergio