![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
iOS开发
zdby11
这个作者很懒,什么都没留下…
展开
-
CocoaPods的安装记录
CocoaPods的作用可以概括为一句话:自动下载第三方开源框架及其依赖框架。CocoaPods的安装也非常简单,在国内网络被墙的情况下只需要以下三行命令(前提是系统中ruby已经安装好,本人的OSX10.10系统自带ruby):1. gem sources --remove https://rubygems.org/ 2. gem sources -a https://ruby.taobao.org/ 3. sudo gem install cocoapods原创 2015-11-07 20:53:40 · 383 阅读 · 0 评论 -
iOS Block循环引用检测
控制器中Block的循环引用往往会导致退出当前控制器,但是该控制器没有释放掉。根据这一点,我们可以在dealloc方法中打印日志来检测控制器中是否出现循环引用。如果dealloc日志没有打印出来说明出现了循环引用。进入控制器的时候打印日志- (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated];原创 2016-05-16 10:48:33 · 795 阅读 · 0 评论 -
Property’s synthesized getter follows Cocoa naming
现在都使用ARC进行iOS开发,所以属性命名不能使用new开始,否则会出现如下错误Property’s synthesized getter follows Cocoa naming convention for returning ‘owned’ objects”原创 2016-05-02 13:15:56 · 376 阅读 · 0 评论 -
pathspec did not match any file known to git
xcode的本地项目中的文件夹删除,新增或者重命名后,如果通过git提交代码时就会出现"pathspec did not match any file known to git"错误,这时可以先commit,后push。如下图所示,不要勾选"Push to remote"选项,输入commit message后,直接点'commit 21 files'。然后,在xcode菜单栏的'So原创 2016-05-01 00:12:20 · 2359 阅读 · 0 评论 -
UITableView的registerClass forCellReuseIdentifier释义
UITableViewCell的重用声明有两种方式:1. registerClass方式。在初始化UITableView的时候顺便声明一下cell的重用,如下所示。[self.tableView registerClass:[CustomCell class] forCellReuseIdentifier:@"CustomCell"];这时就不需要在(UITableViewCell *)t原创 2016-04-30 22:43:37 · 504 阅读 · 0 评论 -
iOS中仿美团的下拉菜单开源组件
1. https://github.com/dopcn/DOPDropDownMenu2. https://github.com/12207480/DOPDropDownMenu-Enhanced3. https://github.com/SmallMonster77/LrdSuperMenu4. https://github.com/MartinLi841538513原创 2016-04-29 09:16:14 · 4685 阅读 · 0 评论 -
iOS9中UIDatePicker的用法
1. 所有可用的地区NSLog(@"%@", [NSLocale availableLocaleIdentifiers]);2.根据上一句代码可以获取所有地区,其中就有大陆,香港,台湾"zh_Hans_CN", "zh_Hant_HK", "zh_Hant_TW"3.UIDatePicker默认的地区是美国,所以显示如下如果要改成中国大陆则要对UIDatePicker原创 2016-04-28 11:27:13 · 1025 阅读 · 0 评论 -
xcode7.3出现the behavior of the UICollectionViewFlowLayout is not defined警告
xcode7.3和iOS9中出现如下警告:the behavior of the UICollectionViewFlowLayout is not defined because:原创 2016-04-27 20:56:03 · 903 阅读 · 0 评论 -
Xcode准确定位产生异常的代码行
1. 在左侧导航栏选中下图圆圈2. 点下图的加号3. 选择“add exception breakpoint”4. 出现下图的断点表示操作成功原创 2016-04-27 18:33:58 · 364 阅读 · 0 评论 -
iOS开发中__weak typeof(self)释义
iOS开发中有一个类型经常用到,通常写法为:__weak typeof(self) weakself = self;这种写法通常出现在block中,这种写法的原因是,block对其变量都是strong reference,在block中使用self也会形成strong reference。而self如果对block也是strong reference的话,就会造成stron原创 2016-04-26 14:41:38 · 1144 阅读 · 0 评论 -
iOS开发问题集锦
NSStringFromSelector(_cmd)_cmd是隐藏的参数,代表当前方法的selector,他和self一样都是每个方法调用时都会传入的参数,动态运行时会提及如何传的这两个参数, 该方法一般用于log中,执行这个方法就会输出方法的名称,这样做是为了跟踪查看方法调用的前后顺序,或者想看看程序到底在那个方法内部崩溃的原创 2016-04-13 12:40:20 · 424 阅读 · 0 评论