1.[AppModel copyWithZone:]: unrecognized selector sent to instance 0x7ffda9f4cf70

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AppModel copyWithZone:]: unrecognized selector sent to instance 0x7ffda9f4cf70'

*** First throw call stack:

这样的错误的原因:属性定义的问题应该注意在定义属性时即在定义

property时几个出现故障的可能能

                               nonatomic:单线程,效率较高

                                atomic:多线程,效率长处低,可是是默认的

                                readWrite:可读可写,它也是默认的

                                readOnly:仅仅可读

                                assign:指的是int,float.等数值类型,他是默认的

                                copy:指的是字符串对象。

比如名字

                                retain:指的是对象。

比如时间对象

                                strong:强引用

                                weak:弱引用

我出错的原因就是在定义类对象时,误用了copy取代strong 

2. 在使用tableView时会发现有时这种方法不运行,原因:_tableViewframe未设置。还有就是_dataArry未赋值是空的。

另一种就是在取的数据时採用的是异步的方式,可是木有刷新tableView数据

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    return nil;

}         

3.数据NSData未初始化带来的错误

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'data parameter is nil'

4.假设取出的数据有为空时就会出现例如以下错误

 *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 3 beyond bounds [0 .. 2]'

相关文章:

  • 2022-12-23
  • 2021-08-14
  • 2021-09-20
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2021-07-25
  • 2022-01-15
猜你喜欢
  • 2022-12-23
  • 2021-07-13
  • 2022-12-23
  • 2021-04-03
  • 2021-07-09
  • 2022-02-20
  • 2022-01-04
相关资源
相似解决方案