摘要: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
阅读全文
摘要:1、根据文本计算size,这里需要传入attributes UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(20, 100, 0, 0)]; label.text = @"12331afaa我是谁的谁"; label.textCo
阅读全文
摘要:/* 屏幕宽高 */ #define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width) #define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height) /* 打印日志
阅读全文
摘要:1、category需要添加属性,可以使用关联对象来扩展对象 objc_setAssociatedObject(id _Nonnull object, const void * _Nonnull key, id _Nullable value, objc_AssociationPolicy poli
阅读全文
摘要:1、BaseUI UI控件基类 (UINavgiationController、UITabBarViewController) 2、Config 项目配置库 一些URL、Color、Strings、Style等配置 3、NetRequest 网络请求类 4、Extension 扩展类 对原有类进行扩
阅读全文
摘要:1、打开xcode,新建一个Single View App。项目名称:MyTest 2、创建成功后,删除这三个文件 ViewController.h ViewController.m Main.storyboard 3、删除info.plist中 Main storyboard file base
阅读全文
摘要:当我们调用一个不存在的方法时,就会报:unrecognized selector sent to instance **。消息接收者找不到对应的selector,这样就启动了消息转发机制,我们可以通过代码在消息转发的过程中告诉对象应该如何处理未知的消息,默认抛出上面的异常。 1、对象在收到未知消息后
阅读全文
摘要:Build Settings -> Apple LLVM 8.1-Language 目录下,找到下面两个标签进行设置 Prefix Header $(SRCROOT)/PrefixHeader.pch 或者 项目名/pch文件名.pch Precompile Predix Header YES
阅读全文
摘要:设置前后的效果图 [searchBar setBackGroundImage:[UIImage new]];
阅读全文
摘要:1、AppIcon 尺寸 iPhone Notification iOS 7-10 20pt 2x( 40x40 ) 3x( 60x60 ) iPhone、Spotlight iOS 5,6 、Settings iOS 5-10 29pt 2x( 58x58 ) 3x( 87x87 ) iPhone
阅读全文
摘要:1、什么是耦合性? 耦合性( Coupling )也叫耦合度,是对模块间关联的度量。耦合的强弱取决于模块间接口的复杂性、调用模块的方式以及通过界面传达数据的多少,模块间的耦合度是指模块之间的依赖关系,包括控制关系、调用关系、数据传递关系。模块间联系越多,其耦合性越强,同时表面独立性越差。划分模块准则
阅读全文
摘要:1、生成指定宽高的UIImage对象(oldImage为原始图片对象,newImage为操作后的图片对象) 2、对UIImage进行裁剪
阅读全文