无法识别的选择器isPitched被调用 [英] unrecognized selector isPitched called
问题描述
在我的应用中,我正在显示带有注释的地图,并且用户可以在表格视图(在模式视图控制器中)中浏览注释列表.
In my app, I am displaying a map with annotations, and the user can browse the list of annotations in a table view (in a modal view controller).
我遇到了一个怪异的错误,可以在设备和模拟器(iOS 7& 8)上重现.
I am experiencing a weird bug that I can reproduce both on device and in the simulator (iOS 7 & 8).
在倾斜模式下,如果我尝试在POI表格视图中选择一个项目,它将执行以下操作之一:
When in pitched mode, if I try to select an item in my POI table view, it does one of these :
- 将地图中心更改为地图上的随机点,而不是所选注释.
- 对我放在下面的消息(启用了NSZombies)感到震惊.
-[__ NSCFString isPitched]:无法识别的选择器已发送到实例0x7f24e6e0
-[__NSCFString isPitched]: unrecognized selector sent to instance 0x7f24e6e0
我尝试了几种方法来解决此错误,但没有成功.而令我困惑的是,我找不到关于isPitched方法的任何信息.它不在我的代码中,也没有在Apple文档中.
I tried several methods to solve this bug, but with no success. And what puzzles me is I can't find any information on the isPitched method. It isn't in my code, neither in Apple documentation.
有人对MapKit和这些类型的问题了解更多吗? 另外,当用户在列表中选择POI时,您是否知道停用音高的方法?也许可以防止该错误.
Does someone knows more on MapKit and these types of problem ? Alternatively, would you know a way to deactivate the pitch when a user select a POI in the list ? Maybe it would prevent the bug.
EDIT : Just found that the 'isPitched' method is actually part of VectorKit ! Doesn't really help, though. No documentation on VectorKit...
添加了堆栈跟踪.
-[__NSCFString isPitched]: unrecognized selector sent to instance 0x7db84870
2015-02-28 14:25:08.501 Cartel 2015[2481:178443] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString isPitched]: unrecognized selector sent to instance 0x7db84870'
*** First throw call stack:
(
0 CoreFoundation 0x00afb946 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x00784a97 objc_exception_throw + 44
2 CoreFoundation 0x00b035c5 -[NSObject(NSObject) doesNotRecognizeSelector:] + 277
3 CoreFoundation 0x00a4c3e7 ___forwarding___ + 1047
4 CoreFoundation 0x00a4bfae _CF_forwarding_prep_0 + 14
5 VectorKit 0x02dd09c1 __86-[VKMapCameraController _animateToPosition:pitch:yaw:duration:timingCurve:completion:]_block_invoke + 1809
6 VectorKit 0x02d88645 -[VKAnimation onTimerFired:] + 357
7 VectorKit 0x02d9895e -[VKScreenCanvas animateWithTimestamp:] + 686
8 VectorKit 0x02d9850e -[VKScreenCanvas updateWithTimestamp:] + 46
9 VectorKit 0x02d71e69 -[VKMapView onTimerFired:] + 89
10 libobjc.A.dylib 0x0079a771 -[NSObject performSelector:withObject:] + 70
11 VectorKit 0x0323463c -[GGLDisplayLink _displayLinkFired:] + 60
12 QuartzCore 0x041abcad _ZN2CA7Display15DisplayLinkItem8dispatchEv + 45
13 QuartzCore 0x041abb83 _ZN2CA7Display11DisplayLink14dispatch_itemsEyyy + 311
14 QuartzCore 0x041ac067 _ZN2CA7Display16TimerDisplayLink8callbackEP16__CFRunLoopTimerPv + 123
15 CoreFoundation 0x00a558d6 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
16 CoreFoundation 0x00a5525d __CFRunLoopDoTimer + 1309
17 CoreFoundation 0x00a146ba __CFRunLoopRun + 2090
18 CoreFoundation 0x00a13bcb CFRunLoopRunSpecific + 443
19 CoreFoundation 0x00a139fb CFRunLoopRunInMode + 123
20 GraphicsServices 0x03f4324f GSEventRunModal + 192
21 GraphicsServices 0x03f4308c GSEventRun + 104
22 UIKit 0x00f318b6 UIApplicationMain + 1526
23 Cartel 2015 0x0001110d main + 141
24 libdyld.dylib 0x046aaac9 start + 1
25 ??? 0x00000001 0x0 + 1
推荐答案
好,我设法通过以下修复来防止崩溃.
OK, I managed to prevent the crash with the following fix.
当我在列表中选择一个POI时,我触发了一个视图控制器的委托方法,该方法从tableView控制器的didSelect方法中处理MapView.如果您有同样的问题,那么我想您到目前为止已经明白我的意思了.
When a POI is selected in my list, I trigger a delegate method of the view controller that handles the MapView from the didSelect method of the controller of the tableView. If you have the same problem, I assume you understand what I mean, so far.
在这种方法中,我要求MapView以POI的坐标为中心.
In this method, I asked the MapView to center itself on the coordinates of the POI.
现在,要解决仅在用户跟踪模式设置为倾斜"(遵循您的方向)时才会发生的问题,我只是在方法的开头添加了一行以停用此跟踪模式:
Now, to solve the problem that only happened when the user tracking mode was set to "pitched" (following your orientation), I simply added a line to deactivate this tracking mode at the beginning of my method :
[mapView setUserTrackingMode: MKUserTrackingModeNone] ;
这删除了随机出现的崩溃.请注意,这不会导致违反直觉的行为,因为在用户移动地图时会自动停用此跟踪模式.
This removed the crashes that randomly appeared. Notice that it doesn't result in a counterintuitive behavior because this tracking mode is automatically deactivated when the user moves the map.
所以问题为我解决了,但是如果您有关于此isPitched选择器以及真正引起问题的原因的任何信息,非常欢迎在此处发布!
So problem solved for me but if you have any information about this isPitched selector and what really caused the problem, you're very welcome to post it here !
这篇关于无法识别的选择器isPitched被调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!