xcode错误集锦
康师傅_攻城狮
闻道有先后,术业有专攻。不耻下问,才是王者风范。技术面前,无年龄大小,无身份地位,还有一点,无男尊女卑
展开
-
xcode 总是输出 Unknown class ViewController in Interface Builder file
网上查了一下,原来是因为我在IB中使用的class没有在源代码中使用到,出现这个错误,是因为这个class只在IB中用到,编译器在其他源文件中没有发现对这个class的引用,于是没有链接那个class。在Main.storyboard中把Viewcontroller改成你的HomeViewController(也就是你启动app的第一个试图控制器类),就不会有该问题了原创 2015-06-26 09:32:08 · 2319 阅读 · 0 评论 -
关于UITableView横扫删除的问题 [NSMutableArray removeObjectAtIndex]
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEdi原创 2015-07-14 11:50:58 · 3706 阅读 · 0 评论 -
让程序停在发生异常的地方——Xcode使用小技巧一则
昨晚偶然读到一篇文章,收获很大,不仅仅是技术上的,而且还发现,只有小孩子才去关注个人博客的主题、样式,大神只关注博文的质量和价值。 本文给大家分享一个Xcode使用技巧。初学者可能会遇到这种情况,程序崩了,Xcode总是停在并高亮程序main函数中的代码。这样我们没办法看到真正抛出异常的地方,也就没办法愉快地解决问题了。对于一些异常(比如段错误等),可能这是合理的,但是有些时候从Xcode给出的提原创 2016-01-08 10:43:51 · 1685 阅读 · 0 评论 -
iOS开发-"performSelector may cause a leak because its selector is unknown"警告原因及其解决办法
问题描述项目中使用到了从字符串创建选择器,编译时发现警告:"performSelector may cause a leak because its selector is unknown"(因为performSelector的选择器未知可能会引起泄漏),为什么在ARC模式下会出现这个警告?经过搜索后,在Stackoverflow上发现了一个令人满意的答案。见 http://sta原创 2016-03-29 10:19:11 · 437 阅读 · 0 评论 -
iOS 开发 设置网络请求允许使用http
控制台打印:Application Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app’s Info.plist file. 原因是:苹果官方为了安全使用了HT原创 2016-01-15 14:19:34 · 10278 阅读 · 0 评论 -
Swift 4.0 纯代码实现UITableView
class ViewControllerI: UIViewController,UITableViewDelegate,UITableViewDataSource { var mytableView : UITableView? let testValue:NSString = "这是测试内容\n这是测试内容\n这是测试内容\n这是测试内容\n这是测试内容\n这是测试内容\n这是测试内原创 2018-02-01 17:46:19 · 1704 阅读 · 0 评论 -
iOS开发-error:Cannot assign to 'self' outside of a method in the init family
我们重写父类的init方法时不注意将init后面的第一个字母写成了小写,在这个方法里面又调用父类的初始化方法(self = [super init];)时会报错,错误信息如下**:error:Cannot assign to ‘self’ outside of a method in the init family原因:只能在init方法中给self赋值,Xcode判断是否为init方法规则:...原创 2018-03-15 11:52:37 · 413 阅读 · 0 评论