-[CLLocation length]: unrecognized selector after table display

╄→гoц情女王★ 提交于 2020-01-17 05:19:49

问题


Quite unexpectedly after doing some minor modifications, my code has started crashing with:

-[CLLocation length]: unrecognized selector sent to instance 0x1b3739c0.

This happens after the app has completed the display of the cells of a table, more precisely after exiting:

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath

I tried putting breakpoints in all length accesses in the code, but none of them was caught. I also set a breakpoint on [NSObject(NSObject) doesNotRecognizeSelector:] and this in fact was caught, but gave no information altogether. I also investigated the crash log but the last contact of the crashing thread with my app was in the main function. How may I discover the point of the program producing the crash?


回答1:


CLLocation does not have a length method, see docs. If it's not your code (you seemed to imply that), maybe it's something in one of your dependencies?

Btw, you should add an exception breakpoint, it should catch that.




回答2:


In fact one the table textfields was incorrectly a CLLocation. The only catch was the timing of the error. Thank you everyone.



来源:https://stackoverflow.com/questions/29701734/cllocation-length-unrecognized-selector-after-table-display

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!