我收到#560 NSInvalidArgumentException 错误,如下所示;

-[_NSObserverList setCursorPosition:]: unrecognized selector sent to instance 0x1702a6ea0

CoreFoundation ___exceptionPreprocess

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x1854f21c0 __exceptionPreprocess
1  libobjc.A.dylib                0x183f2c55c objc_exception_throw
2  CoreFoundation                 0x1854f9278 __methodDescriptionForSelector
3  CoreFoundation                 0x1854f6278 ___forwarding___
4  CoreFoundation                 0x1853f059c _CF_forwarding_prep_0
5  UIKit                          0x18b830418 -[_UIKeyboardTextSelectionController selectTextWithGranularity:atPoint:executionContext:]
6  UIKit                          0x18b8304b0 -[_UIKeyboardTextSelectionController selectTextWithGranularity:atPoint:completionHandler:]
7  UIKit                          0x18b895928 -[_UIKeyboardBasedNonEditableTextSelectionGestureController oneFingerForcePan:]
8  UIKit                          0x18b91b59c -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:]
9  UIKit                          0x18b91eca4 _UIGestureRecognizerSendTargetActions
10 UIKit                          0x18b4e02e8 _UIGestureRecognizerSendActions
11 UIKit                          0x18b37e828 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:]
12 UIKit                          0x18b90ece8 _UIGestureEnvironmentUpdate
13 CoreFoundation                 0x18549f7dc __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
14 CoreFoundation                 0x18549d40c __CFRunLoopDoObservers
15 CoreFoundation                 0x18549d89c __CFRunLoopRun
16 CoreFoundation                 0x1853cc048 CFRunLoopRunSpecific
17 GraphicsServices               0x186e52198 GSEventRunModal
18 UIKit                          0x18b3b82fc -[UIApplication _run]
19 UIKit                          0x18b3b3034 UIApplicationMain
20 MyAppName                      0x100050054 main (main.m:16)
21 libdispatch.dylib              0x1843b05b8 (Missing)

谁能建议我这可能是什么问题?

最佳答案

这种NSInvalidArgumentException,尤其是因为它在私有(private)类上,可能是由于Zombie对象引起的。您正在向不再存在的对象发送一条消息“setCursorPosition:”,但该对象已放置在其中。在这种情况下,为“_NSObserverList”。

尝试与“僵尸对象”诊断对象一起运行,以查找应该接收该消息但不见了的对象。该选项在释放对象时将其保留在内存中,但标记为僵尸。

关于ios - -[_ NSObserverList setCursorPosition :],我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41052157/

10-13 07:34