首页 > 其他 > 详细

unrecognized selector sent to instance&&Auto property synthesis will not synthesize property

时间:2016-01-22 02:55:15      阅读:558      评论:0      收藏:0      [点我收藏+]

程序运行崩溃 :‘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就得一小天啊 ,太坑了

 

unrecognized selector sent to instance&&Auto property synthesis will not synthesize property

原文:http://www.cnblogs.com/Jusive/p/5150040.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!