zoukankan      html  css  js  c++  java
  • unrecognized selector sent to instance&&Auto property synthesis will not synthesize property

    程序运行崩溃 :'NSInvalidArgumentException', reason: '-[MyAnnotation setCoordinate:]: unrecognized selector sent to instance

    产生了一个警告: Auto property synthesis will not synthesize property 'coordinate' declared in protocol 'MKAnnotation'

    一般出现unrecognized selector sent to instance这个方法的时候大部分是因为对象被提前释放,指针变成野指针或者没有初始化就调用.这类bug很难定位所以就需要我们定制DEBUG断点

    1.在Debug菜单中选择 Breakpoints -> Create Symbolic Breakpoint…

    2在Symbol中填写如下方法签名:-[NSObject(NSObject) doesNotRecognizeSelector:]

    3.重新运行就可以定位了.

    不过也不是百试百灵的.......

    我这个错误就不行,那么问题一定是出现在警告的上了--------Auto property synthesis will not synthesize property 'coordinate' declared in protocol 'MKAnnotation'-------

    我这个是mapView的模型(必须遵守<MKAnnotation>协议)

    定义了一个属性  @property (nonatomic) CLLocationCoordinate2D cooreinate;

    就出现了上述警告,Auto property synthesis will not synthesize property这个警告一般都是和系统的命名冲突了,所以就改成@property (nonatomic) CLLocationCoordinate2D coordinate;问题就解决了!

    不得不说,就差了一个字母,不懂得人改bug就得一小天啊 ,太坑了

    挥毫泼墨,书写人生篇章
  • 相关阅读:
    (七)linux 学习 -- 键盘高级操作技巧
    (六)linux 学习 -- 从 shell 眼中看世界
    (五)linux 学习 --重定向
    (四)linux 学习 --使用命令
    (三)linux 学习 --操作文件和目录
    JavaScript封装好的方法
    覆盖Html5默认样式
    CSS的布局整理
    Vue学习笔记
    博客园添加和隐藏导航菜单
  • 原文地址:https://www.cnblogs.com/Jusive/p/5150040.html
Copyright © 2011-2022 走看看