摘要: 1、iOS无法代码关闭软件,只能模拟出用户按Home键,将软件退出的效果: - (void)exitApplication { AppDelegate *appdelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; UIWindow *window = appdelegate.window; ... 阅读全文
posted @ 2018-04-03 23:57 码出境界 阅读(218) 评论(0) 推荐(0)
摘要: // 获取SDWebImage的缓存大小 - (NSString *)cacheSizeFormat { NSString *sizeUnitString; float size = [SDWebImageManager.sharedManager.imageCache getSize]; if(size 1024 && size < 1024 * 1024) { ... 阅读全文
posted @ 2018-04-03 23:56 码出境界 阅读(415) 评论(0) 推荐(0)
摘要: @implementation UIViewController (UIViewControllerExt) - (void)popViewController:(NSString *)controllerStr { for (UIViewController *vc in self.navigationController.viewControllers) { if ... 阅读全文
posted @ 2018-04-03 23:53 码出境界 阅读(748) 评论(0) 推荐(0)
摘要: 1.归档时的路径不能越级存放,原因是归档时不会将路径过程中没有的文件夹创建出来。 正确的写法: // 存储上传文件信息的路径(caches) #define UploadCachesDirectory [[NSSearchPathForDirectoriesInDomains(NSCachesDir 阅读全文
posted @ 2018-04-03 23:46 码出境界 阅读(604) 评论(0) 推荐(0)
摘要: 1、我使用SourceTree时,使用的下面的配置全局忽略: 2、<!--?xml version="1.0" encoding="UTF-8"?--> 远程仓库的url路径不要使用域名,而应该使用ip地址。否则会显示“这是一个无效的url路径”。 阅读全文
posted @ 2018-04-03 23:40 码出境界 阅读(424) 评论(0) 推荐(0)
摘要: 打开终端,用cd命令定位到工程所在的目录,然后调用以下命名即可把每个源代码文件行数及总数统计出来: find . "(" -name "*.m" -or -name "*.mm" -or -name "*.cpp" -or -name "*.h" -or -name "*.rss" ")" -print | xargs wc -l 阅读全文
posted @ 2018-04-03 23:33 码出境界 阅读(10114) 评论(0) 推荐(1)
摘要: 声明文件 实现文件 阅读全文
posted @ 2018-04-03 23:29 码出境界 阅读(213) 评论(0) 推荐(0)
摘要: <!--?xml version="1.0" encoding="UTF-8"?--> 字符串用copy,block用copy,协议用weak,基本数据类型用assign,其他用strong。 阅读全文
posted @ 2018-04-03 23:27 码出境界 阅读(239) 评论(0) 推荐(0)
摘要: <!--?xml version="1.0" encoding="UTF-8"?--> 1.isEqual方法用来判断两个比较者的内存地址是否一样。为了细分,有isEqualToString、isEqualToNumber、isEuqalToValue等,使用时一定要精确使用,比如虽然NSNumbe 阅读全文
posted @ 2018-04-03 23:26 码出境界 阅读(422) 评论(0) 推荐(0)
摘要: 注意:iOS10.0以后,使用openURL会有延迟,需要使用 一、概要 本文中主要就是介绍在iOS中实现打电话、发短信、发邮件三个功能。 每种功能都会给出不同的方法,亲测有效~ 1、打电话 (1)直接跳到拨号界面,代码如下 缺点:电话打完后,不会自动回到原应用,直接停留在通话记录界面。 (2)拨号 阅读全文
posted @ 2018-04-03 17:15 码出境界 阅读(619) 评论(0) 推荐(0)