无法识别的选择器发送到实例
可能的重复:
发送到实例的选择器无法识别
谁能告诉我此错误代码中发生了什么?男人苹果很神秘。我刚刚通过 ObjectiveResource 调用了我知道没问题的数据。
-[NSDecimalNumber allKeys]: unrecognized selector sent to instance 0x5c671f0
2011-03-02 02:07:56.169 Mobile[13839:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSDecimalNumber allKeys]: unrecognized selector sent to instance 0x5c671f0'
*** Call stack at first throw:
(
0 CoreFoundation 0x0133bbe9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x014905c2 objc_exception_throw + 47
2 CoreFoundation 0x0133d6fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x012ad366 ___forwarding___ + 966
4 CoreFoundation 0x012acf22 _CF_forwarding_prep_0 + 50
5 Mobile 0x00013aa5 +[NSObject(JSONSerializableSupport) deserializeJSON:] + 832
6 Mobile 0x000138ad +[NSObject(JSONSerializableSupport) deserializeJSON:] + 328
7 Mobile 0x00012f0e +[NSObject(JSONSerializableSupport) fromJSONData:] + 161
8 Mobile 0x0000c8fa +[NSObject(ObjectiveResource) findAllRemoteWithResponse:] + 336
9 Mobile 0x0000c933 +[NSObject(ObjectiveResource) findAllRemote] + 43
10 Mobile 0x00004732 -[AllTableViewController refresh] + 103
Possible Duplicate:
Unrecognized selector sent to instance
Can anyone tell me what is going on in this error code? Man apple is cryptic. I have just made a call via ObjectiveResource to data I know is fine.
-[NSDecimalNumber allKeys]: unrecognized selector sent to instance 0x5c671f0
2011-03-02 02:07:56.169 Mobile[13839:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSDecimalNumber allKeys]: unrecognized selector sent to instance 0x5c671f0'
*** Call stack at first throw:
(
0 CoreFoundation 0x0133bbe9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x014905c2 objc_exception_throw + 47
2 CoreFoundation 0x0133d6fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x012ad366 ___forwarding___ + 966
4 CoreFoundation 0x012acf22 _CF_forwarding_prep_0 + 50
5 Mobile 0x00013aa5 +[NSObject(JSONSerializableSupport) deserializeJSON:] + 832
6 Mobile 0x000138ad +[NSObject(JSONSerializableSupport) deserializeJSON:] + 328
7 Mobile 0x00012f0e +[NSObject(JSONSerializableSupport) fromJSONData:] + 161
8 Mobile 0x0000c8fa +[NSObject(ObjectiveResource) findAllRemoteWithResponse:] + 336
9 Mobile 0x0000c933 +[NSObject(ObjectiveResource) findAllRemote] + 43
10 Mobile 0x00004732 -[AllTableViewController refresh] + 103
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
正如其他人指出的那样,
NSDecimalNumber
不响应allKeys
选择器,从而导致崩溃。发生这种情况可能是因为 NSDictionary 的实例(预期的消息响应者)由于某种原因(缺少保留?)而被过早释放,并且它在内存中的地址被获取错误消息的 NSDecimalNumber 实例占用。
因此,要解决该问题,请尝试找到该消息行并检查该代码中的内存管理是否一切正常。
As others pointed
NSDecimalNumber
does not respond toallKeys
selector and that causes a crash.That may happen because the instance of NSDictionary, the intended message responder was prematurely deallocated for some reason (lack of retain?) and its address in memory got occupied by
NSDecimalNumber
instance that gets that wrong message.So to fix that problem try locating the line that message and check if everything is ok with memory management in that code.
您在
NSDecimalNumber
上调用 allKeys 方法,并且NSDecimalNumber
不能使用此方法,这就是您崩溃的原因。使用
NSDictionary
或NSMutableDictionary
调用 allKeys 方法。因此,在获取此日志后输入
where
,您将在此处获得需要编辑代码的行号。You calling allKeys method on
NSDecimalNumber
,andNSDecimalNumber
can,t use this method thats why you having a crash.allKeys method call with
NSDictionary
orNSMutableDictionary
.so type
where
after getting this log you get line number at there you need to edit the code.NSDecimalNumber 不支持 allKeys 方法。
NSDecimalNumber does not support the method allKeys.