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 服务器注意事项
    维基逃离MySQL 力挺开源数据库 MariaDB
    服务器性能优化
    1 Nginx + 12 Tomcat +2DB 实现2个程序负载均衡
    服务器虚拟化技术 对比简介
    vSphere虚拟系统 添加虚拟服务器
    IIS停止服务 报错Connections_Refused
    windows服务器 IIS FTP服务
    tomcat solr服务无法搜索中文
    查看php相关信息
  • 原文地址:https://www.cnblogs.com/Jusive/p/5150040.html
Copyright © 2011-2022 走看看