NSOperationQueue观察者的内存泄漏?

时间:2017-08-17 06:59:15

标签: memory-leaks automatic-ref-counting instruments key-value-observing nsoperationqueue

我的应用程序随机崩溃,因为我已经使用KVO进行NSOperationQueue。我确实运行了仪器,发现ARC保留计数情况。

enter image description here

这是我的代码。

@try
{
    [[ApplicationManager sharedInstance].operationsQueue removeObserver:self forKeyPath:@"operations"];
}
@catch( NSException *exception )
{
    //NSLog(@"caught exception trying to remove an observer we are not observing");
}

[[ApplicationManager sharedInstance].operationsQueue addObserver:self forKeyPath:@"operations" options:0 context:NULL];

如果有人可以指出正确的方向,那就太棒了。

0 个答案:

没有答案
相关问题