Solve Error: 'NSInvalidArgumentException', reason: '-[UITableView mas_makeConstraints:]: unrecognized selector sent to instance 0x7fa5c402fa00'
下面是iOS开发用第三方库可能出现的错误,及其解决方法:
1. 'NSInvalidArgumentException', reason: '-[UITableView mas_makeConstraints:]: unrecognized selector sent to instance 0x7fa5c402fa00'
这个是使用Masonry库时遇到的,Masonry库是做Auto Layout的神器,封装的特别好,用几行代码就可以实现非常复杂的自动排布功能。这个错误的产生原因可能是因为直接将第三方库拖入项目中,那么还是需要设置target membership,解决方法如下:
- Choose every *.m file, go to File Inspector
- Go to Target Membership, check your app target.
2. Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView sd_setImageWithURL:placeholderImage:options:]: unrecognized selector sent to instance 0x7fd2f3f0f8c0'
这个是使用SDWebImage库时遇到的,SDWebImage库是图片下载及缓存池管理的神器,全都封装好了,只需要给需要下载的图片的url,和占位图片就行了,这个错误产生的原因跟上面的一样,所以解决方法也一样:
- Choose every *.m file, go to File Inspector
- Go to Target Membership, check your app target.
3. Incompatible block pointer types sending 'void (^)(NSInteger, NSInteger)' to parameter of type 'SDWebImageDownloaderProgressBlock _Nullable' (aka 'void (^)(NSInteger, NSInteger, NSURL * _Nullable __strong)')
这个错误还是使用SDWebImage库时遇到的,原因是SDWebImageDownloaderProgressBlock的Signature在新版本中变了,之前是:
typedef void(^SDWebImageDownloaderProgressBlock)(NSInteger receivedSize, NSInteger expectedSize);
后来改成这样了:
typedef void(^SDWebImageDownloaderProgressBlock)(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL);
所以在调用的时候改一下就行了:
[self sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:imageName] options:SDWebImageRetryFailed|SDWebImageLowPriority progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) {
// Do something here
} completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
// Do something here
}];
Solve Error: 'NSInvalidArgumentException', reason: '-[UITableView mas_makeConstraints:]: unrecognized selector sent to instance 0x7fa5c402fa00'的更多相关文章
- -[UITableView copyWithZone:]: unrecognized selector sent to instance 0x7XXXXXX00
-[UITableView copyWithZone:]: unrecognized selector sent to instance 0x7XXXXXX00 -[Class copyWithZon ...
- IOS 错误 [UIWebView cut:]: unrecognized selector sent to instance
那在什么场景中会出现这种情况呢? 如果一个包含文字的输入元素有焦点,然后按钮的点击会导致输入失去焦点,然后接下来在输入时双按会重新得到焦点并从弹出bar中选择剪切复制粘贴,就会导致此error. 也就 ...
- unrecognized selector sent to instance 0x10b34e810
一个错误: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSURLEr ...
- __NSArrayI removeObjectAtIndex:]: unrecognized selector sent to instance
同样是删除cell问题,帮我看看问题出现在哪,谢谢! 我的类文件myFile是继承UIViewController的(目的是为了能够在一个view里切换不同的tableView),在myFile.h中 ...
- iOS 程序报错:reason: [NSArrayI addObject:]: unrecognized selector sent to instance
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI ad ...
- [UIView setShowsFPS:]: unrecognized selector sent to instance XXX
今天在做sprite Kit game时遇到一个问题. 新建一个项目运行时发现就加了这几句代码无法运行.后来一查原来是storyboard uiview要改一下.改成SKview In your st ...
- ios unrecognized selector sent to instance出现的原因和解决方案
概述:造成unrecognized selector sent to instance iphone,大部分情况下是因为对象被提前release了,在你心里不希望他release的情况下,指针还在,对 ...
- 出现“unrecognized selector sent to instance”问题原因之一及解决方法。
对于iPhone开发初学者来说,很想实现自己在iPhone上的第一个小程序,准备工作就绪侯就信心满满的开始了!一般来说大家可能都是从Hello World做起吧. 反正我是的,:),如果按照文 ...
- IOS微信API异常:unrecognized selector sent to instance 0x17005c9b0'
开发IOS整合微信API的时候,在运行程序的过程中可能会在注册你的APPID的时候抛出此异常而导致程序崩溃. 异常描述 [7661:2826851] *** Terminating app due t ...
随机推荐
- poj3669 Meteor Shower(预处理+bfs)
https://vjudge.net/problem/POJ-3669 先给地图a[][]预处理每个位置被砸的最小时间.然后再bfs. 纯bfs,还被cin卡了下时间.. #include<io ...
- CentOS下双网卡双IP不同IP段配置
环境: eth0:10.0.7.2 gw :10.0.7.254 netmask:255.255.255.0 eth1:168.6.101.2 gw :168.6.101.254 net ...
- spring跨域问题
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Co ...
- JS 正则表达式从地址中提取省市县
var add1 = '四川省西昌市航天路'; var add2 = '北京市北京市东城区前门大街1号' var add3 = '新疆维吾尔自治区乌鲁木齐市天山区中山路479号'; var add4 ...
- 对Unity的Resources目录进行改名
项目用的是Unity5.5版本,开发的时候将相关的图集.预制对象资源都放在 Resources 目录下,而真机使用的是 StreamingAssets 目录下的资源. Resources(不分层级)在 ...
- 微信小程序开发注意事项总结:上拉加载失效、转义字符等
1.上拉加载失效 问题背景:部分页面上拉加载失效.当使用flex布局,底部固定,中间采用自适应撑满全屏实现滚动时,发现上拉加载失效,不知道是什么原因. 解决问题: 在小程序中,官方为我们提供了原生的下 ...
- mysql函数之SUBSTRING_INDEX(str,"/",-1)
SUBSTRING_INDEX的用法: •SUBSTRING_INDEX(str,delim,count) 在定界符 delim 以及count 出现前,从字符串str返回自字符串.若count为正值 ...
- PornHub 正式发布 AI自动标注色情演员引擎
http://igeekbar.com/igeekbar/post/501.htm Pornhub已经宣布推出一款全新的成人片识别引擎,这款引擎由AI驱动,使用计算机视觉技术自主检测和识别成人片内容以 ...
- springcloud如何实现服务的平滑发布
在之前的文章中我们提到服务的优雅下线,见: SpringCloud服务如何在Eureka安全优雅的下线 但这个对于ribbon调用其实是不平滑的,shutdown请求到后服务就马上关闭了,服务消费此时 ...
- 在IIS7上导出所有应用程序池的方法批量域名绑定(网站绑定)
资料来源: http://www.2cto.com/os/201410/341882.html 一点经验:导出配置文件后,建议打开看看,如果有需要调整的需要做修改. 在IIS7+上导出所有应用程序池的 ...