2019年1月21日

iOS 中的round、ceil、floor

摘要: roundf(float)、round(double)、roundl(long double) 如果是参数是小数,返回值为四舍五入后的整数 NSLog(@"%f - %f - %f",round(3.4),round(3.5),round(3.6)); 3.000000 - 4.000000 - 4 阅读全文

posted @ 2019-01-21 15:47 7890陈 阅读(818) 评论(0) 推荐(0) 编辑

2018年11月12日

Python 模块

摘要: 1、模块(Module) Python模块是一个Python文件,以.py结尾,包含了Python对象定义和Python语句。 模块能够让你更有逻辑组织你的代码段 模块能定义函数、类和变量,模块里也能包含可执行的代码 模块 support.py def print_func( par ): prin 阅读全文

posted @ 2018-11-12 16:21 7890陈 阅读(119) 评论(0) 推荐(0) 编辑

2018年9月21日

iOS UILabel计算宽度和高度

摘要: 1、根据文本计算size,这里需要传入attributes UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(20, 100, 0, 0)]; label.text = @"12331afaa我是谁的谁"; label.textCo 阅读全文

posted @ 2018-09-21 17:46 7890陈 阅读(324) 评论(0) 推荐(0) 编辑

2018年9月20日

iOS 常用的宏

摘要: /* 屏幕宽高 */ #define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width) #define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height) /* 打印日志 阅读全文

posted @ 2018-09-20 10:07 7890陈 阅读(107) 评论(0) 推荐(0) 编辑

2018年9月19日

iOS 关联对象(Associated Object)

摘要: 1、category需要添加属性,可以使用关联对象来扩展对象 objc_setAssociatedObject(id _Nonnull object, const void * _Nonnull key, id _Nullable value, objc_AssociationPolicy poli 阅读全文

posted @ 2018-09-19 17:02 7890陈 阅读(159) 评论(0) 推荐(0) 编辑

2018年8月2日

iOS 项目分组目录

摘要: 1、BaseUI UI控件基类 (UINavgiationController、UITabBarViewController) 2、Config 项目配置库 一些URL、Color、Strings、Style等配置 3、NetRequest 网络请求类 4、Extension 扩展类 对原有类进行扩 阅读全文

posted @ 2018-08-02 14:36 7890陈 阅读(210) 评论(0) 推荐(0) 编辑

iOS 新建空工程

摘要: 1、打开xcode,新建一个Single View App。项目名称:MyTest 2、创建成功后,删除这三个文件 ViewController.h ViewController.m Main.storyboard 3、删除info.plist中 Main storyboard file base 阅读全文

posted @ 2018-08-02 11:54 7890陈 阅读(163) 评论(0) 推荐(0) 编辑

2018年7月12日

iOS 消息转发

摘要: 当我们调用一个不存在的方法时,就会报:unrecognized selector sent to instance **。消息接收者找不到对应的selector,这样就启动了消息转发机制,我们可以通过代码在消息转发的过程中告诉对象应该如何处理未知的消息,默认抛出上面的异常。 1、对象在收到未知消息后 阅读全文

posted @ 2018-07-12 15:25 7890陈 阅读(141) 评论(0) 推荐(0) 编辑

2017年9月26日

iOS 配置pch文件

摘要: Build Settings -> Apple LLVM 8.1-Language 目录下,找到下面两个标签进行设置 Prefix Header $(SRCROOT)/PrefixHeader.pch 或者 项目名/pch文件名.pch Precompile Predix Header YES 阅读全文

posted @ 2017-09-26 10:54 7890陈 阅读(116) 评论(0) 推荐(0) 编辑

2017年9月25日

iOS 去掉UISearchBar输入框上面的黑线

摘要: 设置前后的效果图 [searchBar setBackGroundImage:[UIImage new]]; 阅读全文

posted @ 2017-09-25 14:15 7890陈 阅读(242) 评论(0) 推荐(0) 编辑

导航