English 中文(简体)
MapKit/Location 管理人员在卸载时坠机
原标题:MapKit/Location Manager crashes app when unloading view

我在申请中坠毁了“EXC_BAD_ACCESS”,当时我打上了我航道的背后钥匙,而该观点卸下了地图Kit(地图集)并使用了定位主管。 • 安排好好几天时间,最后为处理这个问题的任何人找到一个固定点:

在您的议事录中加入这一法典

- (void)dealloc {
    mapView.delegate = nil;
    locationManager.delegate = nil;

    [mapView release];
    [locationManager release];
}
问题回答

我也这样说: 是的,这一规定实际上是一种适当的固定办法;

- (void)dealloc {
  mapView.delegate = nil;
  locationManager.delegate = nil;

  [mapView release];
  [locationManager release];
}

幕后发生的情况是:

  1. 你击中了后方。 这一卸载并因此释放了持有地图意见的控制器。 由于很有可能只提及控制器,因此会处理。

  2. 然而,地籍管理很有可能在地位的内在工作中被提及。

  3. 如果所在地Manager和(或)地图上目前向各自代表发出通知,他们就跟着一个无效的点。 它将产生EXC_BAD_ACCESS例外。

是:让代表们认为自己是好主意。 我刚才希望的 Apple果会在那里增加一些汽车。





相关问题
Ruby Interpreter crashes with a certain word

Ok, this one s a little ridiculous, and I m almost afraid no one will believe me. But here it goes: I have written a Ruby Rails application that handles content for tons of domains. Now I know this ...

Java HotSpot error

Curious if anyone could help out in regards to a Java HotSpot dump...saw some reference to head over to the Sun Forums, figured I would try here first...below is the dump... # # An unexpected error ...

NSOperation performSelectorOnMainThread crashes

I m calling a NSOperation from a Subview of a NavigationController. MyOperation *op = [[MyOperation alloc] target:self action:@selector(didFinishOperation)]; The Operation loads some data from a ...

Is this kind of crash report useless?

I tried use "PLCrashReport" to collect the crash info then make the app more stable, but turns out that the report is like this(dont even has a call stack,how am I suppose to use it?): The "Exception:...

Xcode crashes with divide by zero

I downloaded urlcache.zip from http://developer.apple.com/iphone/library/samplecode/URLCache/index.html#//apple_ref/doc/uid/DTS40008061 I opened the project in xcode and clicked on urlcacheconection....

热门标签