Xcode插件的实现-JSON格式化
发表于|更新于
|浏览量:
背景:开发中经常遇到需要格式化JSON字符串的情况,每次都是百度在线格式化解析好不方便,某天看到APP Store里有Xcode关于这个的插件,卖的老贵了,哈哈哈,于是就想自己也弄一个,先调研一下JSON格式化的实现原理,然后再看看Xcode插件的实现,最后还可以写个Mac版,给自己大大的赞😄
文章作者: 今是昨非
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 今是昨非的博客!
相关推荐
2022-04-14
Algorithem_ReverseArray
Algorithem_ReverseArrayGiven an array, rotate the array to the right by k steps, where k is non-negative. Example 1: 12345678Input: nums = [1,2,3,4,5,6,7], k = 3Output: [5,6,7,1,2,3,4]Explanation:rotate 1 steps to the right: [7,1,2,3,4,5,6]rotate 2 steps to the right: [6,7,1,2,3,4,5]rotate 3 steps to the right: [5,6,7,1,2,3,4] Example 2: 1234567Input: nums = [-1,-100,3,99], k = 2Output: [3,99,-1,-100]Explanation: rotate 1 steps to the right: [99,-1,-100,3]rotate 2 steps to the right: [3,9...
2022-04-21
Algorithem_Populating Next Right Pointers in Each Node
Algorithem_Populating Next Right Pointers in Each NodeYou are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following definition: 123456struct Node { int val; Node *left; Node *right; Node *next;} Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL. Initially, all next pointers are set to NULL. Example 1: 12Input: root...
2016-01-04
轮播图实现的三种方式
轮播图实现的三种方式假设有5张图片,分别是:12345,实现轮播图 方法1:用scrollView加NSTimer实现,思路:12345五张图片,实现轮播,我添加两张,变成5123451,当滑到最后一个1时,无动画位移回第一个1;当倒着滑到5时,无动画回最后的5。 难点在于:给定数组的个数,及两个边界的判断 方法2:用collectionView加NSTimer实现,思路:12345五张图片,对应collectionView的1个section,即一个section有5个row;至于有多少个section,尽量设置的大一些,eg:100;(collectionView有重用机制)所以不用担心内存问题。 难点在于:滑动的逻辑处理;如果你把section设置的非常大,就不用担心倒着滑的问题,毕竟不是每个人都那么闲。 1234567891011121314151617181920- (void)nextPage:(id)sender { // 1. 得到当前正在显示的cell的indexPath,(只有一个) NSIndexPath *currentI...
2019-09-28
Embedded binary is not signed with the same certificate as the parent app
Embedded binary is not signed with the same certificate as the parent app背景Xcode 10之后New Build System变为默认,编译之后一直报错,报错信息:Embedded binary is not signed with the same certificate as the parent app. Verify the embedded binary target’s code sign settings match the parent app’s. eg: 但是在Legacy Build System下就没有问题。刚开始直接粗暴的改回Legacy Build System,一直没来得及查具体原因,最近得空了,仔细查了一下。 过程搜到的好多人说,是因为keyChain里证书的信任状态不对,要用系统默认,不能强制始终信任。but,我检查了之后,我的证书确实是系统默认的状态。 在stackoverflow上iOS error “Embedded binary is not signed ...
2021-08-30
iOS 在文件中访问 Document Directory
iOS 在文件中访问 Document DirectoryiOS 11之后,在 Plist 中设置LSSupportsOpeningDocumentsInPlace为 YES,且UIFileSharingEnabled为 YES,可以从系统的Files应用中访问应用的 Documents 目录。 如下: 从系统的文件打开,查看我的 iPhone如下,开启了此功能的应用可以从这里面看到 注意:此目录是 APP 的Documents目录,所以 APP 删除后,目录就消失了。 参考: iOS文件共享
2021-06-07
CocoaPod 私有库Spec依赖.a写法
CocoaPod 私有库Spec编辑注意事项CocoaPod 私有库Spec依赖.a写法 PodSpec详细描述如下, 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869Pod::Spec.new do |s| # 库名称 s.name = 'AudioRecorder' # 库的版本 s.version = '0.1.0' # 库摘要 s.summary = 'AudioRecorder提供iOS录音和录音播放功能' # 库描述 s.description = <<-DESC AudioRecorder提供iOS录音和录音播放功能 DESC # 远程...
公告
This is my Blog