【发布时间】:2011-08-19 12:18:05
【问题描述】:
我从 xib 加载我的视图。当尝试释放时,它会崩溃并显示消息:
Designer Project(72849,0xa08c0540) malloc: * 对象错误 0x4b06000: 被释放的指针未被分配 * 在 malloc_error_break 中设置断点来调试当前语言: 汽车;目前客观-c
这是我的实现:
@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
}
请帮助解决问题。 谢谢。
【问题讨论】:
标签: objective-c uiview crash xib