由于存在多种情况需要从导航堆栈中弹出视图控制器,因此我有一种方法可以实现此功能,并且可以从三个不同的位置调用它。无法将CLLocationManager委托设置为无
- (void)dismissSelfCon {
NSLog(@"dismiss");
[locationManager stopUpdatingHeading];
[locationManager stopUpdatingLocation];
locationManager.delegate = nil;
mapView.delegate = nil;
[[NSNotificationCenter defaultCenter] removeObserver:self];
[[[Trail_TrackerAppDelegate appDelegate] navCon] popViewControllerAnimated:YES];
}
在一种情况下,如果MapView获得置于其上的注释(我不知道这是决定性的特点,但我认为这是),这种方法称为(我敢肯定它被调用是因为@“dismiss”被打印到控制台),但位置管理器不会停止发送位置更新!另外,因为委托没有设置为零,所以应用程序崩溃是因为视图控制器从它是委托的对象之一接收到respondsToSelector:。
这怎么可能?
我想通了,现在发布解决方案。 –