chiery'blog


  • Home

  • Tags

  • Categories

  • Archives

Notification 传输流程

Posted on 2016-07-02 | In APNs | Visitors:

Notification 传输流程

说到Notification的传输流程,其实是包含了三个部分的,这三个部分也是我们需要了解的Notification的核心内容。

Provider-to-APNs Connection Trust
APNs-to-Device Connection Trust
Token Generation and Dispersal

服务端到APNs的链接建立信任,下面先来看一张图

Read more »

Notification

Posted on 2016-07-02 | In APNs | Visitors:

Notification

苹果的notification包含了两个类型

Local Notification
Remote Notification

当接收到推送的时候,我们可以做出相应的提示

一个AlertView提示
一个Application icon上的badge
一个语音

我们可以将Local Notification 和 Remote Notification当成一种类型来处理,这样对于用户来说是比较容易接受的,毕竟都是推送。但是如果你想定制不同的类型,也是可以的,苹果给出了每个类型对应的API,所以对于单独的定制也是支持的。

Read more »

what new in swift

Posted on 2016-06-23 | In swift | Visitors:

What new in swift

Swift 开源已有6个月,开源社区讨论从未停歇过。Swift3 的目标有以下4点:

1、发展开源社区
2、新平台的可移植性
3、开放更多基础功能
4、持续优化

目前公布的 Sierra macOS 系统中,大部分 Misson Control 都已经使用 Swift 重写,甚至 Accessibility 引擎完全使用了 Swift。

这里WWDC还举了Dock的一个🌰,讲述关于这个20万行代码的应用使用 Swift 重写后代码量减少了15%之多,同时又增加了一些新功能。

Read more »

为JSPatch添加NSInteger,BOOL,CGFloat,double类型的地址传递解析

Posted on 2016-06-01 | In JSPatch | Visitors:

JSPath添加封装

使用场景,针对客户端中常常使用这样的实参形式来保存地址中的值。

// 声明变量a
NSInteger a = 0;

// 取地址a做容器承接值
[self changA:&a];

// 改变a地址中的值
- (void)changeA:(NSInteger *)a {
    *a = 10;
}
Read more »

CoreAudio

Posted on 2016-05-03 | In ios | Visitors:

CoreAudio

CoreAudio提供了一套软件技术来方便开发者实现audio的一些特性,其中就包含了录制,播放,音效处理,定位,格式转换,文件流处理,同时包含:

* 可以在应用中使用内嵌的平衡器和混响器
* 自动获取音频的IO
* 将电话设备的信息应用到应用中
* 在不干扰音效的情况下减少或是延长电池寿命

CoreAudio包含了C和OC的API,从而可以通过灵活的编程环境来保持一个低延迟音频信号链。

Read more »

ios中各种锁的对比

Posted on 2016-04-22 | In 性能对比 | Visitors:

iOS各种锁的对比

为什么要引入锁?这是每个在学习ios锁的同学都会有的疑问。简单来说,ios语言是多线程的,当多个线程操作一个对象,且这个对象的操作要求是有序的时候,就需要的这个对象加锁。

eg:
    ios中存在一个数据库
    a/b/c/d业务都会像这个业务中存取数据
    a/b/c/d业务操作是异步的

就会存在这样一个情况,a在根据条件删除数据库中的数据,b在向数据库中添加数据。a/b是异步执行的,就可能a在执行的时候,b添加了元素,a继续执行,b添加的元素被删除。这样就与a执行完成在执行b冲突。

这个时候就引入了锁的概念

Read more »

iterm替代terminal

Posted on 2016-02-23 | In 系统 | Visitors:

iterm 替代teminal

最近在推荐的文章中看到了一个有关工具类的推荐,其中有一篇是说的iterm,界面之绚丽,但是就吸引了我的注意。今天实现了相应的效果。先上图看一下最终的效果

Read more »

KMP算法

Posted on 2016-02-02 | In KMP | Visitors:

KMP 算法

在简单的字符串匹配算法中我们一般会使用这样的匹配demo去做处理,返回子串T在主串S,pos之后的位置,这里子串在主串中重复的情况。

int Index(SSTring S,SSTring T, int pos) {
    if (!S || !T) return
    if (!(pos >=0 && pos < S.length)) return
    int i = pos; j = 0;
    while(i < S.lenth && j < T.length) {
        if (S[i] == T[j]) j++;
        else j = 0;
        i++;
    } 
    if (j > T.length) return i - T.length;
    else return 0;
}
Read more »

二叉树

Posted on 2016-01-27 | In Optimization | Visitors:

二叉树

第一次接触这个概念的时间是在大二的时候,时隔多年之后,没想到还是绕回来了,这一次就花点时间记录下二叉树的实现,分析一下可能的用途,产生一个记忆点,并记录起来。真叹息以前大学的时候没能做记录,大把的时间都挥霍于青春!

Read more »

Welcome to Jekyll!

Posted on 2016-01-08 | In jekyll | Visitors:

jekyll

You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run jekyll serve --watch, which launches a web server and auto-regenerates your site when a file is updated.

To add new posts, simply add a file in the _posts directory that follows the convention YYYY-MM-DD-name-of-post.ext and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.

Read more »
1234

John Doe

持续、专注

37 posts
25 categories
15 tags
© 2019 John Doe
Powered by Hexo
|
Theme — NexT.Muse v5.1.4