zoukankan      html  css  js  c++  java
  • 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]'

  • 相关阅读:
    Nginx之HTTP过滤模块
    Nginx之编写HTTP模块
    Nginx之最简单的反向代理机制分析
    Nginx之搭建反向代理实现tomcat分布式集群
    Nginx之configure选项
    Nginx-HTTP之ngx_http_top_body_filter
    Nginx-HTTP之ngx_http_top_header_filter
    Nginx-HTTP之静态网页访问流程分析二
    error: ‘Poco::UInt16’ has not been declared
    字符数组中查找字符串或字符数组
  • 原文地址:https://www.cnblogs.com/clnchanpin/p/7253717.html
Copyright © 2011-2022 走看看