学习iOS分享世界MG的iOS经验总结

MG--错误总结(不定时更新)

2016-12-27  本文已影响275人  Mg明明就是你

总结自己在开发过程中遇到的BUG


第1和第2个错误
第3个错误
第4个错误 第5个错误
第6个错误
第7个错误
第8个错误
第9个错误 第10个错误


第11个错误

![第12个错误]](http:https://img.haomeiwen.com/i1429890/b982f103cc502475.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

第十三个错误:

第十三个错误

第十四个错误:iOS9 https协议

第十四个错误 原因

第十五个错误:(直接拖入动画框架POP的错误)

第十五个错误

第十七个错误:NAN的错误

第十七个错误

第十八个错误:未定义的错误

第十八个错误

第十九个错误:bitcode的错误

第十九个错误:bitcode的错误

第二十个错误:真机调试下静态库架构问题

第二十个错误:真机调试下静态库架构问题
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_WKWebView", referenced from:
      objc-class-ref in BSWebViewController.o
ld: symbol(s) not found for architecture x86_64
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_BSWebViewController", referenced from:
      objc-class-ref in BSMeController.o
ld: symbol(s) not found for architecture x86_64
解决真机调试下静态库架构问题


第二十一个错误:使用FMDB遇到的错误(SWift)

Snip20160601_28.png

第二十二个错误:设置状态栏出现的警告错误

  • 第二十二个错误:设置状态栏出现的警告错误
  • ❎错误描述:CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
  • 原因:View controller-based status bar appearance设置为NO
  • ✅解决方法:修改方式将View controller-based status bar -appearance设置为YES,然后使用新的方式来实现状态栏的样式。
- (UIStatusBarStyle)preferredStatusBarStyle;
- (UIViewController *)childViewControllerForStatusBarStyle;
- (void)setNeedsStatusBarAppearanceUpdate


第二十三个错误:莫名错误--静态库不支持某种架构


第二十四个错误:莫名错误--duplicate symbols for architecture x86_64(重复编译)

第一种情况:在工程中重复导入了某一个类或文件,这一般出现在你添加第三方库的时候比较多,在不知道的情况下又导入了一次相同的类。
第二种情况:工程中在#import引入头文件的时候,将#import "XXX.h" 写成了#import "XXX.m"。错误的引入.m头文件 ```


第二十五个错误:(友盟分享)_rkl_NSExceptionForRegex in MOBFoundation

Undefined symbols for architecture x86_64:
  "_u_errorName", referenced from:
      _rkl_NSExceptionForRegex in MOBFoundation
      _rkl_userInfoDictionary in MOBFoundation
      _cm_rkl_NSExceptionForRegex in AGCommon
      _cm_rkl_userInfoDictionary in AGCommon
  "_u_strlen", referenced from:
      _rkl_userInfoDictionary in MOBFoundation
      _cm_rkl_userInfoDictionary in AGCommon
  "_uregex_setText", referenced from:
      -[MOBFRKLBlockEnumerationHelper initWithRegex:options:string:range:error:] in MOBFoundation
      _rkl_performRegexOp in MOBFoundation
      _rkl_clearCachedRegexSetTo in MOBFoundation
      -[CMRKLBlockEnumerationHelper initWithRegex:options:string:range:error:] in AGCommon
      _cm_rkl_performRegexOp in AGCommon
      _cm_rkl_clearCachedRegexSetTo in AGCommon
  "_uregex_start", referenced from:
      _rkl_performRegexOp in MOBFoundation
      _rkl_findRanges in MOBFoundation
      _rkl_search in MOBFoundation
      _cm_rkl_performRegexOp in AGCommon
      _cm_rkl_findRanges in AGCommon
      _cm_rkl_search in AGCommon
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Undefined symbols for architecture armv7
Undefined symbols for architecture armv7s
Undefined symbols for architecture arm64
Undefined symbols for architecture i386
Undefined symbols for architecture x86_64

第二十六个错误:Xcode8运行报错--签名必须加入某个team


第二十七个错误:Swift3.0归档报错--需要强引用


第二十八个错误:使用第三方框架PopoverSwift报错--需要约束


第二十九个错误: Swift3.0使用NSUserDefaults存储Bool类型

SaveTools.mg_SaveToLocal(value: isAddMoveAnimation, key: "isAddMoveAnimation")  // 就是这句代码,先要存储一下该Bool类型
isAddMoveAnimation = SaveTools.mg_getLocalData(key: "isAddMoveAnimation") as! Bool
titleLabel?.text = titleStr ?? "其他工作"
if isAddMoveAnimation == false {
        self.addMoveAnimation(label: titleLabel!)
        isAddMoveAnimation = true
        SaveTools.mg_SaveToLocal(value: isAddMoveAnimation, key: "isAddMoveAnimation")
}

第三十个错误: Swift3.0使用导航栏给item添加约束报错





第三十二个错误: 项目一段时间没用,莫名报错


  • 第三十三个错误:设置导航栏全局属性的BUG


第三十四个错误:Swift导入编译文件两次的错误

第三十五个错误:证书真机安装安装失败

第三十六个错误:打包上传失败

第三十七个错误:Modal错误

Warning: Attempt to present * on * which is already presenting *
Warning: Attempt to present (要被presented的控制器)  on (哪个控制器来presenting) which is already presenting (已经被presenting的控制器)
self: 是被presented出来的控制器,
self.presentingViewController: 看看是谁把self给presenting出来
RPLog(@"%@ - %@", self.presentingViewController, [UIApplication sharedApplication].keyWindow.rootViewController);
打印结果: <RPNavigationController: 0x789d0330> - <RPNavigationController: 0x789d0330>```
`ProductionReport[98607:30384979] Warning: Attempt to present <UIAlertController: 0x7f8d0ae431b0>  on <ProductionReport.QRCodeViewController: 0x7f8d0ac04af0> which is already presenting (null)`
- ✅解决:
  - 结论: poopver中的控制器, 其实是通过窗口的根控制器presenting出来的, 所以要想窗口的根控制器再presenting其他控制器,需要先dismiss掉原来presenting的控制器,
上一篇 下一篇

猜你喜欢

热点阅读