Bug

汇总一些遇到的BUG


AutoLayout有时候会出现:

    Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 

(

    "<NSLayoutConstraint:0x17ef4e10 V:[UIView:0x17ee9e00]-(0)-|   (Names: '|':UIView:0x17ef3e10 )>",

    "<NSLayoutConstraint:0x17ef4e70 V:|-(0)-[UIView:0x17ee9e00]   (Names: '|':UIView:0x17ef3e10 )>",

    "<NSLayoutConstraint:0x17dc8650 'UIView-Encapsulated-Layout-Height' V:[UIView:0x17ef3e10(455)]>",

    "<NSAutoresizingMaskLayoutConstraint:0x17dc86b0 h=-&- v=-&- 'UIView-Encapsulated-Layout-Top' V:|-(0)-[UIView:0x17ef3e10]   (Names: '|':UIViewControllerWrapperView:0x17d7ac80 )>",

    "<NSAutoresizingMaskLayoutConstraint:0x17d90d50 h=--& v=--& UIView:0x17ee9e00.midY == + 184>"

)

错误原因可能是:在添加约束的时候,比如说 水平方向的约束leading trailing和 weight 冲突了系统会帮我们去掉宽度的限制

解决方法: 重新添加约束,选择性的不添加宽度<根据情况不添加一些约束>


JSON解析数据 for循环嵌套错误

-[__NSCFString countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x7fff32fabdc0


JSON解析数据,方式不对

-[__NSCFString objectForKeyedSubscript:]: unrecognized selector sent to instance 0x7f85d4110700

原因: 解析字典时,定义的是数组;解析数组时,定义的是字典


setValue:ForUnderfinedKey:]:this class is not key value coding

原因:连线出问题了


-[ViewController up]: unrecognized selector sent to instance 0x8c50af0

原因:某个对象没有实现某个方法


"_SCNetworkReachabilityCreateWithName", referenced from:

原因:静态库中依赖的一些框架没有导入.如果静态库中用到了框架就必须导入


"std::terminate()", referenced from:

但凡看到错误提示中提示两个冒号,表示C++代码, 默认情况下Xcode创建的工程是不支持C++.

如何解决: 将工程中任意一个文件的后缀改为.MM即可

.c  --> C代码

.cpp --> C++代码

.m  --> C代码 + OC代码

.MM -->C代码 + OC代码 + C++代码


Undefined symbols for architecture x86_64:

这个错误, 一般是指用到的三方框架不支持64位手机

解决方式: 打开工程 --> Build Settings --> All --> Architectures --> Debug\Release --> Other -->修改为  $(ARCHS_STANDARD_32_BIT)






  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值