我的应用程序因以下错误而崩溃:
-[__NSCFDictionary length]: 无法识别的选择器发送到实例 0x178669400 2014-08-08 16:24:14.397 TestAPP[7196:60b] *** 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[__NSCFDictionary 长度]:无法识别的选择器发送到实例 0x178669400”
它不是代码的一部分。我尝试在 viewcontroller.m 文件中添加断点。我找不到导致此错误的行。我为 [NSObject doesNotRecognizeSelector:] 添加了符号断点:Debug Navigator showed me issue in the UIVIEW layer。知道什么可能是错的吗?我添加了调试导航器的屏幕截图。
线程1栈如下图:
有了异常断点,我可以看到以下内容:
这是崩溃的堆栈跟踪:
CRASH: -[__NSCFDictionary length]: unrecognized selector sent to instance 0x17826aa00
Application Memory Usage 46649344
Device Orientation 5
Total space 28096 Total Free Space 20312
Stack Trace: (
0 CoreFoundation 0x000000018cd2711c <redacted> + 160
1 libobjc.A.dylib 0x00000001992301fc objc_exception_throw + 60
2 CoreFoundation 0x000000018cd2bdb4 <redacted> + 0
3 CoreFoundation 0x000000018cd29ae0 <redacted> + 912
4 CoreFoundation 0x000000018cc4978c _CF_forwarding_prep_0 + 92
5 UIKit 0x000000018fcfc0a4 <redacted> + 44
6 UIKit 0x000000018fd75b04 <redacted> + 112
7 UIKit 0x000000018fd75a34 <redacted> + 364
8 QuartzCore 0x000000018f90cf7c <redacted> + 140
9 QuartzCore 0x000000018f8f755c <redacted> + 2436
10 QuartzCore 0x000000018f8f6bc8 <redacted> + 112
11 QuartzCore 0x000000018f8f6758 <redacted> + 1260
12 QuartzCore 0x000000018f8d701c <redacted> + 244
13 QuartzCore 0x000000018f8d6ce4 <redacted> + 44
14 QuartzCore 0x000000018f8d6560 <redacted> + 280
15 QuartzCore 0x000000018f8d6304 <redacted> + 424
16 UIKit 0x000000018fcef154 <redacted> + 9800
17 CoreFoundation 0x000000018cce77f4 <redacted> + 24
18 CoreFoundation 0x000000018cce6b50 <redacted> + 256
19 CoreFoundation 0x000000018cce4de8 <redacted> + 632
20 CoreFoundation 0x000000018cc25dd0 CFRunLoopRunSpecific + 452
21 GraphicsServices 0x000000019290dc0c GSEventRunModal + 168
22 UIKit 0x000000018fd56fc4 UIApplicationMain + 1156
23 PrototypeN 0x000000010019af88 main + 116
24 libdyld.dylib 0x0000000199823aa0 <redacted> + 4
)
最佳答案
您正试图在某处获取字典的长度。我的猜测是您正在尝试获取您认为是 NSString
但实际上是 NSDictionary
的长度。
关于ios - -[NSObject doesNotRecognizeSelector :]: 的符号断点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25213710/