• iOS学习(项目中遇到的错误1)


    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]'

  • 相关阅读:
    DDD实战进阶第一波(三):开发一般业务的大健康行业直销系统(搭建支持DDD的轻量级框架二)
    DDD实战进阶第一波(二):开发一般业务的大健康行业直销系统(搭建支持DDD的轻量级框架一)
    01-JavaScript之变量
    18-TypeScript模板方法模式
    17-TypeScript代理模式
    16-TypeScript装饰器模式
    15-TypeScript策略模式
    真的可以「 人人都是产品经理 」吗
    如何从程序员到架构师?
    除代码之外,程序员还有哪些能力也非常的关键?
  • 原文地址:https://www.cnblogs.com/clnchanpin/p/7253717.html
Copyright © 2020-2023  润新知