我正在实现基于MKMapView的应用程序。在我点击一个别针时,我正在使用观察者。观察者代码如下,使用KVO时出现异常
[annView addObserver:self
forKeyPath:@"selected"
options:NSKeyValueObservingOptionNew
context:@"ANSELECTED"];
它正在为例外,但过一段时间就越来越例外“EXC_BAD_ACCESS”。我的日志如下,它显示我泄漏的内存。我需要释放服务器吗?如果我 ?那么我应该在哪里发布这个?你们能帮我解决吗?
An instance 0x1b21f0 of class MKAnnotationView is being deallocated while key value observers are still registered with it. Observation info is being leaked, and may even become mistakenly attached to some other object. Set a breakpoint on NSKVODeallocateBreak to stop here in the debugger. Here's the current observation info:
( 语境:0x2b588,物业:0x1acaa0>
由于提前, S.
而是志愿的,为什么不直接使用didSelectAnnotationView委托方法? – Anna 2010-11-01 18:10:54