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

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

出现这个错误的原因是,全局的属性的修饰词写错了,

比如一个view 本来应该用weak和strong 修饰,结果你写成了copy  那么就会出现这个错误

错误:

@property (nonatomic,copy) UITableView *tableView;     //tableView;

正确:

@property (nonatomic,strong) UITableView *tableView;     //tableView;

下面来自外国兄台的回答给大家个参考

Your -setObj1: method is declared as copy, so it calls -copy on your Class1 object. -copy just calls -copyWithZone:nil. So you either need to implement the NSCopying protocol (which means implementing -copyWithZone:), or change your property from copy to retain.

To make your class respond to copyWithZone:, you have to implement the NSCopying protocol in your class. And you must override the copyWithZone: method.

要实现自定义对象copy,需遵守NSCopying、NSMutableCopying协议,实现copyWithZone、mutableCopyWithZone 方法

更多关于copy请看

https://blog.csdn.net/qq_25639809/article/details/80048843

 

-[UITableView copyWithZone:]: unrecognized selector sent to instance 0x7XXXXXX00的更多相关文章

  1. Solve Error: 'NSInvalidArgumentException', reason: '-[UITableView mas_makeConstraints:]: unrecognized selector sent to instance 0x7fa5c402fa00'

    下面是iOS开发用第三方库可能出现的错误,及其解决方法: 1. 'NSInvalidArgumentException', reason: '-[UITableView mas_makeConstra ...

  2. reason: -[UIKBBlurredKeyView candidateList]: unrecognized selector sent to instance

    reason: -[UIKBBlurredKeyView candidateList]: unrecognized selector sent to instance 发现上线的app一直会有这个cr ...

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

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

  4. '-[__NSCFString stringFromMD5]: unrecognized selector sent to instance 0x14d89a50'

    类型:ios 问题描述: 导入百度地图 然后在模拟器运行可以,真机测试不行: 报错: '-[__NSCFString stringFromMD5]: unrecognized selector sen ...

  5. unrecognized selector sent to instance

    今天长一见识(特此感谢小星星老湿-坏笑),凡是遇到“unrecognized selector sent to instance *******”的都是******方法没有,比如这种的错误: 可以尝试 ...

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

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

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

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

  8. -[__NSCFNumber length]: unrecognized selector sent to instance 0xb0000000000000e3

    网络数据解析出现-[__NSCFNumber length]: unrecognized selector sent to instance 0xb0000000000000e3这样的错误,具体 re ...

  9. CBUUID UUIDString unrecognized selector sent to instance 错误

    CBUUID UUIDString unrecognized selector sent to instance 错误 ios7.0,4s 蓝牙出现上述错误! 查看api可知,错误原因,由于CBUUI ...

随机推荐

  1. Oracle使用expdp/impdp迁移数据

    Oracle使用expdp/impdp迁移数据 1.#以下步骤在开发库执行(expdp导出) 一.创建逻辑目录,该命令不会在操作系统创建真正的目录,最好以system等管理员创建. sqlplus / ...

  2. J2SE 容器

    知识点:Collection接口.Iterator接口.增强的for循环.Set接口.List接口和Comparable接口.Collection类.Map接口.自动打包/解包.泛型 容器:API文档 ...

  3. flask项目

    虚拟环境需要 pipenv install flask pipenv install flask-sqlalchemy pipenv install python-dotenv pipenv inst ...

  4. Linux服务器性能分析与优化

    影响服务器性能的因素: CPU :大部分cpu在同一时间只能运行一个线程,超线程的处理器可以在同一时间处理多个线程,因此可以利用超线程特性提高系统性能. 在linux系统下,只有运行SMP内核才能支持 ...

  5. Beta冲刺第5次

    二.Scrum部分 1. 各成员情况 翟仕佶 学号201731103226 今日进展 新增将图片转为粉笔画功能代码 存在问题 难者不会,会者不难,主要是参数设置问题 明日安排 视情况而定,可能还是写扩 ...

  6. python测试开发django-66.图片403forbidden

    前言 用 django 开发 web 页面,在 HTML 页面上添加图片时,发现本地图片可以正常显示,但是添加一个互联网的图片,却不能正常显示. 本地 static 图片 先在本地 static 放一 ...

  7. springBoot 日志中关于profiles设置的源码解读

    在启动SpringBoot应用是看到到如下日志,于是出于好奇查看了下源代码: 首先,StartpInfoLogger类,采用jcl-over-slf4j[即Apache Common Log]中的Lo ...

  8. 51nod1803 森林直径

    [传送门] 考虑计算直径的 dp 方法. $d[u]$ 表示以 $u$ 为根的子树能 $u$ 能走到的最远距离 $dp[u]$ 表示以 $u$ 为根的子树的直径那么每次dfs一个子节点后$dp[u] ...

  9. 传统ELK分布式日志收集的缺点?

    传统ELK图示: 单纯使用ElK实现分布式日志收集缺点? 1.logstash太多了,扩展不好. 如上图这种形式就是一个 tomcat 对应一个 logstash,新增一个节点就得同样的拥有 logs ...

  10. luogu_4568: 飞行路线

    洛谷4568: 飞行路线 题意: 给定一张无向图有\(n\)个点编号为\(0\)到\(n-1\).共有\(m\)条边,每条边有一个边权. 可以选择\(k\)条边将边权改变为\(0\),给定起点和终点, ...