ios通过NSURLSession进行网络请求,参考另一篇博客ios进行网络请求

在开发阶段,server端我们会用self-signed证书(省钱啊!)。正因为不是第三方机构认证的证书,所以客户端都会报警告。我们需要对此进行处理(参考NSURLSession in Apple Tech NoteHow do I accept a self-signed SSL certificate using iOS 7’s NSURLSession and its family of delegate methods for development purposes?):

Read on →
web

摘录在此,备忘。

HTTPS其实是有两部分组成:HTTP + SSL / TLS,也就是在HTTP上又加了一层处理加密信息的模块。服务端和客户端的信息传输都会通过TLS进行加密,所以传输的数据都是加密后的数据。

具体的加密过程看下图:

Read on →

这一段时间,在对自己不是很了解的代码进行重构,重新了解了一下Property、Instance Variable和@synthesize,总结一下。

首先需要明白一点:Property和@synthesize是让编译器帮助我们做一些规律性的工作。

如果没有Property

如果没有Property,我们可以这样实现Instance Variable的accessor(getter和setter),示例代码如下:

Read on →

在iOS中有三类事件:

  • 触控事件(单点、多点触控以及各种手势操作)
  • 传感器事件(重力、加速度传感器等)
  • 远程控制事件(远程遥控iOS设备多媒体播放等)

这里要讨论的是触控事件的机制。

iOS中主要有两种触控事件:

  • 手势识别类定义的触控事件
  • UIResponder中定义的触控事件
Read on →

For basic configuration of octopress blog, go to official site for references.

Issue with OS EI Caption (10.11)

After updating OS to EI Caption (10.11), there is some bugs when we run rake preview. You need to update your ruby version, and reinstall dependencies of octopress.

Refer to Errno::ENOENT: No Such File or Directory - Jekyll ~ Octopress and El Capitan post for more details.

If you can still not update your ruby version using the way in the above post, try the following commands (Refer to Using Rbenv to Manage Multiple Versions of Ruby for more details.) before install new ruby version:

  • Add rbenv init to your shell to enable shims and autocompletion:
1
2
$ echo 'eval "$(rbenv init -)"' >> $HOME/.bash_profile
$ source ~/.bash_profile
  • Restart shell as a login shell so that the PATH changes take effect:
1
$ exec $SHELL -l

Themes

Go to here to choose the theme you like. Personally, I like the boldandblue theme. It is simple and elegant.

Read on →

Google Maps Android API utility library (the github repo and the documentation) supplies multiple cool features, including

  • Marker clustering — handles the display of a large number of points
  • Heat maps — display a large number of points as a heat map
  • IconGenerator — display text on your Markers
  • Poly decoding and encoding — compact encoding for paths, interoperability with Maps API web services
  • Spherical geometry — for example: computeDistance, computeHeading, computeArea
  • KML — displays KML data (Caution: Beta!)
  • GeoJSON — displays and styles GeoJSON data
Read on →