下面是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'的更多相关文章

  1. -[UITableView copyWithZone:]: unrecognized selector sent to instance 0x7XXXXXX00

    -[UITableView copyWithZone:]: unrecognized selector sent to instance 0x7XXXXXX00 -[Class copyWithZon ...

  2. IOS 错误 [UIWebView cut:]: unrecognized selector sent to instance

    那在什么场景中会出现这种情况呢? 如果一个包含文字的输入元素有焦点,然后按钮的点击会导致输入失去焦点,然后接下来在输入时双按会重新得到焦点并从弹出bar中选择剪切复制粘贴,就会导致此error. 也就 ...

  3. unrecognized selector sent to instance 0x10b34e810

    一个错误: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSURLEr ...

  4. __NSArrayI removeObjectAtIndex:]: unrecognized selector sent to instance

    同样是删除cell问题,帮我看看问题出现在哪,谢谢! 我的类文件myFile是继承UIViewController的(目的是为了能够在一个view里切换不同的tableView),在myFile.h中 ...

  5. iOS 程序报错:reason: [NSArrayI addObject:]: unrecognized selector sent to instance

    *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI ad ...

  6. [UIView setShowsFPS:]: unrecognized selector sent to instance XXX

    今天在做sprite Kit game时遇到一个问题. 新建一个项目运行时发现就加了这几句代码无法运行.后来一查原来是storyboard uiview要改一下.改成SKview In your st ...

  7. ios unrecognized selector sent to instance出现的原因和解决方案

    概述:造成unrecognized selector sent to instance iphone,大部分情况下是因为对象被提前release了,在你心里不希望他release的情况下,指针还在,对 ...

  8. 出现“unrecognized selector sent to instance”问题原因之一及解决方法。

      ​ 对于iPhone开发初学者来说,很想实现自己在iPhone上的第一个小程序,准备工作就绪侯就信心满满的开始了!一般来说大家可能都是从Hello World做起吧. 反正我是的,:),如果按照文 ...

  9. IOS微信API异常:unrecognized selector sent to instance 0x17005c9b0'

    开发IOS整合微信API的时候,在运行程序的过程中可能会在注册你的APPID的时候抛出此异常而导致程序崩溃. 异常描述 [7661:2826851] *** Terminating app due t ...

随机推荐

  1. .ipynb格式文件

    ipynb,即ipython notebook,需要用ipython notebook打开,IPython Notebook是web based IPython封装,但是可以展现富文本,使得整个工作可 ...

  2. 100本Python精品书籍(附pdf电子书下载)

    51本Python精品书籍(附下载)链接: https://pan.baidu.com/s/19ydAKCFxM0plkepXMlqQLg 提取码: nnpe 400集python视频教程下载:链接: ...

  3. Multiple Tasks Z

    public static async Task executeParallel<T>(this IEnumerable<T> items, int limit, Func&l ...

  4. 14、Spark的核心术语

    Application:spark应用程序,就是用户基于spark api开发的程序,一定是通过一个有main方法的类执行的,比如java开发spark,就是在eclipse中,建立的一个工程 App ...

  5. 2.1 mac下多版本jdk的安装和管理

    之前已经安装过jdk8了,安装路径:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk 现在安装jdk10,下载后,双击dmg文件一直到安装完成,安装 ...

  6. 转: 关于CAS cpu锁的技术说明。

    写的不错.原文链接如下: https://blog.csdn.net/dviewer/article/details/51943140 部分摘要: 2016年07月18日 16:30:08 阅读数:3 ...

  7. php5.6.11编译安装报错configure: error: Don't know how to define struct flock on this system

    centos 6.8 32位系统下,安装php.5.6.11是出现这个错误 解决办法: 1 2 3 4 vim /etc/ld.so.conf.d/local.conf     # 编辑库文件 /us ...

  8. MySQL 8 中新的复制功能

    MySQL 8 中新的复制功能使得操作更加方便,并帮助用户更好地观察复制过程中内部发生的情况. 使用 MySQL 5.7.17 获取 MySQL 组复制插件是一项巨大的工作.组复制是一个新的插件,通过 ...

  9. vue2.0 技巧汇总

    /** * Created by */ export default { trim: (str) => { //删除左右两端的空格 return str.replace(/(^\s*)|(\s* ...

  10. golang:常量

    今天写代码的时候才发现,go语言里面的常量不能是数组(例如:[2]byte) 于是想查一下资料搞清楚到底是什么原因导致的,从effective go查到如下介绍: 但是这里也仅仅就是介绍了一下常量类型 ...