语法 - Objective-C 中实现枚举类型(Enum)与字符串(NSString)互相转换
变更记录
序号
录入时间
录入人
备注
1
2017-06-16
Alfred Jiang
-
方案名称语法 - Objective-C 中实现枚举类型(Enum)与字符串(NSString)互相转换
关键字语法 \ 枚举类型 \ Enum \ 字符串 \ NSString \ 转换 \ 转化
需求场景
需要在 Objective-C 中支持枚举类型与字符串转换时
参考链接
简书 - 深入浅出理解有限状态机(推荐)
Stacck Overflow - Easy way to use variables of enum types as string in c
详细内容宏定义12345678910111213141516171819202122232425262728293031323334#pragma mark - Enum Factory Macros// expansion macro for enum value definition#define ENUM_VALUE(name,assign) name assign,// expansion macro f ...
内存管理 - 使用 retain 找出对象的持有者
变更记录
序号
录入时间
录入人
备注
1
2017-06-27
Alfred Jiang
-
方案名称内存管理 - 使用 retain 找出对象的持有者
关键字内存管理 \ retain \ 对象持有者 \ 内存泄露
需求场景
通过获取对象的引用图来确定持有者,从而发现并解决内存泄露问题
参考链接
《高性能 iOS 应用开发》
详细内容如果想要找出对象的持有者,可以通过 MRC 的 retain 方法
第一步:确定需要追踪的对象为 MRC,如果工程是基于 ARC 开发的,可以在工程配置中关闭需要追踪的对象对应类文件的 ARC
在 工程 -> TARGETS -> Build Phases -> Compile Sources 中设置对应类文件的 Compiler Flags 为 -fno-objc-arc 即可
第二步:将以下代码添加到所要追踪的自定义类中
1234567#if !__has_feature(objc_arc)- (id)retain{ NSLog(@"%s %@",__PRETTY_FUNCTI ...
字体 - iOS 系统字体查询
变更记录
序号
录入时间
录入人
备注
1
2016-11-30
Alfred Jiang
-
方案名称字体 - iOS 系统字体查询
关键字字体 \ 系统字体
需求场景
需要查询 iOS 设备系统支持字体时
参考链接
iOS Fonts(推荐)
详细内容可以通过 iOS Fonts 快速查询各个 iOS SDK 版本全部系统字体支持情况效果图
备注
字体 - 添加自定义字体
相册 - 保存 GIF 动画图片至相册
变更记录
序号
录入时间
录入人
备注
1
2016-12-01
Alfred Jiang
-
方案名称相册 - 保存 GIF 动画图片至相册
关键字相册 \ GIF \ 动图保存
需求场景
需要保存 GIF 图片至相册时
参考链接
[伯乐在线 - ](iOS 关于 GIF 图片那点事)(推荐)
详细内容引入头文件1234#import <Photos/Photos.h>#import <AssetsLibrary/AssetsLibrary.h>
保存函数如下1234567891011121314151617181920212223242526272829303132333435- (void)saveImageData:(NSData *)imageData completionBlock:(void (^)(NSError *error))completionBlock{ if ([UIDevice currentDevice].systemVersion.floatValue >= 9.0f) { ...
Git - 把指定 commit 合并到当前分支
变更记录
序号
录入时间
录入人
备注
1
2016-12-02
Alfred Jiang
-
方案名称Git - 把指定 commit 合并到当前分支
关键字Git \ 合并指定 commit 合并到当前分支
需求场景
需要将其他分支 commit 合并至当前分支时
参考链接
Segmentfault - git 为某次提交新建分支(只合并某次提交到一个分支上)(推荐)
详细内容1. 命名行方式将 commit-id 的递交应用至当前分支
1git cherry-pick commit-id
2. SourceTree选中想要合并至当前分支 -> 右键点击 -> 选择遴选 -> 确认
效果图(无)
备注(无)
工具 - Sublime Text 3 - Mac 下 Sublime Text 3 安装使用与插件推荐
变更记录
序号
录入时间
录入人
备注
1
2016-12-02
Alfred Jiang
-
方案名称工具 - Sublime Text 3 - Mac 下 Sublime Text 3 安装使用与插件推荐
关键字工具 \ Sublime Text 3 \ 插件安装
需求场景
Sublime Text 3 使用参考
参考链接
Sublime text 2/3 中 Package Control 的安装与使用方法(推荐)
简书 - 如何优雅地使用Sublime Text3
详细内容1. 下载 Sublime Text 32. 安装 Package Control通过 菜单 -> View -> Show Console 或者 control + ` 打开 console , 将以下 Python 代码粘贴进去并 Enter 执行, 完成后重启 Sublime Text
1import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sub ...
Git - 使用 rebase 命令保持主分支树的整洁
变更记录
序号
录入时间
录入人
备注
1
2016-12-20
Alfred Jiang
-
1
2017-03-15
Alfred Jiang
更新”注意事项”部分
方案名称Git - 使用 rebase 命令保持主分支树的整洁
关键字Git \ rebase \ merge \ 分支 \ 合并
需求场景
合并主分支至子分支时,使用 rebase 保持主分支树的整洁,方便版本回退和问题追踪
主要用在从主分支获取最新 commit 信息,并将当前子分支与主分支进行合并
参考链接
Git Community Book 中文版 - rebase(推荐)
Git Community Book 中文版
i@2(7*2d - Git教程(7)用合并还是变基?
详细内容rebase 介绍关于 rebase 的使用场景说明可以参考以下链接
Segmentfault - 团队开发里频繁使用 git rebase 来保持树的整洁好吗?
知乎 - 在开发过程中使用git rebase还是git merge,优缺点分别是什么?
关于 rebase 的具体使用方法可以参考以下链接 ...
Xcode - 真机调试问题 (Could not locate device support files)
变更记录
序号
录入时间
录入人
备注
1
2016-12-15
Alfred Jiang
-
方案名称Xcode - 真机调试问题 (Could not locate device support files)
关键字Xcode \ 真机无法调试问题 \ iOS 7 真机联调 \ Could not locate device support files
需求场景
升级至 Xcode 8 之后无法联机调试 iOS 7 设备时
参考链接
简书 - Xcode8 无法真机调试问题(推荐)
详细内容在开发证书配置正常的情况下,发生真机无法联调问题,一般是由于 Xcode 支持的设备版本与真机系统版本不一致导致的
如果真机系统版本 大于 Xcode 支持的设备版本, 则升级 Xcode 即可
如果真机系统版本 小于 Xcode 支持的设备版本, 则需要拷贝与真机版本匹配的设备配置包至 Xcode 对应目录下
一般设备配置包所在目录为:
1/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.pla ...
网络 - HTTPS 网络请求真机抓包(Mac & Windows)(Fiddler & Charles)(Fiddler & Charles)
变更记录
序号
录入时间
录入人
备注
1
2016-12-26
Alfred Jiang
-
1
2017-09-14
Alfred Jiang
增加部分安卓机型和 iOS 版本安装注意
方案名称网络 - HTTPS 网络请求真机抓包(Mac & Windows)(Fiddler & Charles)(Fiddler & Charles)
关键字网络 \ 抓包 \ HTTPS \ Fiddler \ Charles
需求场景
需要对真机进行 HTTPS 请求抓包时
参考链接
CSDN - 使用Charles抓https请求包
博客园 - fiddler 抓包http和https以及android平台下抓取
博客园 - 抓包工具Charles使用教程
CSDN - 【HTTP】Fiddler(二) - 使用Fiddler做抓包分析
详细内容一、Mac 下使用 Charles 进行 HTTPS 抓包1. 安装 Mac 端证书:Mac 端打开 Charles, 顶部工具栏 -> Help -> SSL Proxying -> ...
工具 - OmniGraffle 使用介绍
变更记录
序号
录入时间
录入人
备注
1
2017-02-11
Alfred Jiang
-
方案名称工具 - OmniGraffle 使用介绍
关键字工具 \ OmniGraffle \ 流程图 \ 组织结构图 \ 软件原型 \ 平面图 \ UML
需求场景
Mac 端打开 Visio 编辑文件
Mac 端绘制流程图、组织结构图、软件原型以及平面图等
参考链接(见详细内容)
详细内容
简书 - OmniGraffle (一)从工具栏开始
简书 - OmniGraffle (二)对象的控制
简书 - OmniGraffle (三)基础绘图和模具
简书 - OmniGraffle (四)化繁为简
效果图(无)
备注(无)