【发布时间】:2016-12-31 10:42:52
【问题描述】:
我只在 iOS8 中遇到此错误,在 iOS9 中工作正常
[DetailView respondsToSelector:]: message sent to deallocated instance 0x7c818a20
我有什么方法可以找到我的对象正在取消分配的位置吗?
我知道xcode中有工具zoombie,但它只提供上述信息,我也尝试过分析但没有任何帮助。
我也放置了异常断点,但控制没有在代码中的任何地方中断。
在我的 MainVC.m 中设置一个属性 @property (nonatomic,strong) DetailView *d;
单击 MainVC.m 中的按钮(我必须将此详细视图添加为子视图)
_d = [[DetailView alloc]initWithData:dict andImgId:[[_arrayHotelimg objectAtIndex:0] valueForKey:@"img_id"] isTour:NO];
_d.dictData = [_dbObj getHotelDescriptionDataFromHid:_iTabId];
_d.delegate = self;
[self.view addSubview:_d];
DetailView.m
-(id)initWithData:(NSDictionary*)dict andImgId:(NSString*)imgId isTour:(BOOL)isTour{
self = [super initWithFrame:CGRectMake(0, TOP, SCREEN_WIDTH, SCREEN_HEIGHT)];
if (self)
{
self.arrGalleryImages = [NSMutableArray new];
_dbObj = [Database Connetion];
NSArray *subviewArray = [[NSBundle mainBundle] loadNibNamed:@"DetailView" owner:self options:nil];
self = [subviewArray objectAtIndex:0];
self.frame = CGRectMake(0, TOP, SCREEN_WIDTH, SCREEN_HEIGHT);
}
return self;
}
任何人都可以帮助我了解如何找到正在破坏的代码或对象释放的位置吗?
为什么它在 iOS9 上运行而不在 iOS8 上运行?
【问题讨论】:
-
你添加了“AllExeption断点”吗?
-
是的,但代码控制不会在任何地方中断。查看我更新的帖子
-
我现在帮你。导航到下一个视图控制器时遇到同样的问题,或者在某些地方显示类似的错误。首先显示你的导航编码。
标签: ios memory-management xcode7