iOS错误记录
来源:互联网 发布:编程珠玑 编辑:程序博客网 时间:2024/06/10 18:31
错误1:linker command failed with exit code 1
原因:引入第三方库很常见到“inker command failed with exit code 1 (use -v to see invocation)”错误。今天也有幸邂逅了。
处理:具体解决方法,请移步下面地址:http://blog.csdn.net/duxinfeng2010/article/details/8265273
错误2:如何实例化storyboard中创建的viewcontroller
处理:在调用之前,需要在storyboard里,给目标ViewController设置identifier,然后
// 从storyboard创建MainViewController UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"nailshop" bundle:[NSBundle mainBundle]]; YLSMainViewController *mainViewController = (YLSMainViewController*)[storyboard instantiateViewControllerWithIdentifier:@"mainViewController"]; [self presentViewController:mainViewController animated:YES completion:nil];参考:(http://blog.csdn.net/kyfxbl/article/details/17687265)
错误3:NSInternalInconsistencyException
错误:uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
原因:直接使用了self.tableView,并未对其实例化
处理:创建storyboard或xib,实例化view后再使用
错误4:whose view is not in the window hierarchy!
原因:从stroyboard中取controller时候出现问题
处理:不在ViewDidLoad方法中调,而是在viewDidAppear:方法中调
参考:http://stackoverflow.com/questions/11862883/whose-view-is-not-in-the-window-hierarchy
错误5:[NSNull countByEnumeratingWithState:objects:count:]: unrecognized selector
原因:使用空对象调用了countBy……方法
处理:增加判断条件,判断为空不执行,由于接收到的空为:<null>因此不能用==,nil,Nil,等常规方法,使用![resultArrisEqual:[NSNullnull]]
参考:http://blog.csdn.net/hg_lin/article/details/16965137
错误6: Unknown type name 'CGRect'; did you mean 'Rect'?
原因:在xcode6以前构建的工程是携带pch文件,里面默认有如下句子
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif
而在xcode6构建的是需要手动引入的。
处理:引入<UIKit/UIKit.h>
参考:http://stackoverflow.com/questions/26169273/cgrect-unrecognized-in-subclasses-of-nsobject
错误7:could not set nil as the value for the key
原因: 使用KVC设置could not set nil as the value for the key 时候遇到了空值。
处理:重写setNilValueForKey,
参考:http://supershll.blog.163.com/blog/static/3707043620121144446889/
- iOS错误记录
- iOS 错误记录
- iOS学习笔记: 错误记录
- ios应用提交错误记录
- IOS开发常见错误记录
- ios 项目添加AdMob 错误记录
- iOS swift HTTPS 9813错误解决记录
- java pns 向 IOS 推送消息错误记录
- 错误记录
- 错误记录
- 错误记录
- 错误记录
- 错误记录
- 错误记录
- 错误记录
- 错误记录
- 错误记录
- 错误记录
- 加入外键产生错误码
- easyui之关闭窗口时触发关闭事件
- 四、面向对象 对象扩展与成长
- linux下tar.gz、tar、bz2、zip等解压缩、压缩命令小结
- android shape的使用详解以及常用效果(渐变色、分割线、边框、半透明阴影效果等)
- iOS错误记录
- 会话:追踪长时间的运动轨迹,对运动数据进行分析,用户可以调整并分享会话。
- http协议总结
- 第四章数组和指针(数组)
- NanShan即时通讯 ie6 ie7 ie8 不支持json 终极解放方案
- c/c++ c++ file c++/stl/boost 判断文件目录是否存在
- 【COM/ATL】创建Url快捷方式
- 50_leetcode_longest SubString without Repeating charactors
- 错误java.util.ConcurrentModificationException