在Xcode7.0及以上版本中编译iOS APP时,默认会使用iOS9的一项新特性,使得所有http连接被禁用,项目里使用的API没有https支持,就悲剧了。差了官方文档,有这么一段话

App Transport Security

App Transport Security (ATS) enforces best practices in the secure connections between an app and its back end. ATS prevents accidental disclosure, provides secure default behavior, and is easy to adopt; it is also on by default in iOS 9 and OS X v10.11. You should adopt ATS as soon as possible, regardless of whether you’re creating a new app or updating an existing one.

If you’re developing a new app, you should use HTTPS exclusively. If you have an existing app, you should use HTTPS as much as you can right now, and create a plan for migrating the rest of your app as soon as possible. In addition, your communication through higher-level APIs needs to be encrypted using TLS version 1.2 with forward secrecy. If you try to make a connection that doesn’t follow this requirement, an error is thrown. If your app needs to make a request to an insecure domain, you have to specify this domain in your app’s Info.plist file.

>>> 阅读全文

微信WeChatSDK出现Undefined symbols for architecture x86_64错误

今天在写iOS项目时,需要用到微信登陆模块,所以引入了微信官方的iOS SDK,但是编译时一直出Mach-O的错误,怀疑是SDK本身的问题。于是建了个新的空项目,导入WeChatSDK,依旧报错,报错内容一致: >>> 阅读全文


有时候我们需要有多个component的UIPickerView并且对应不同的内容,比如地区的选择,需要有省份和城市两个选项,选择不同的省份,城市要相应发生变化。 >>> 阅读全文


iOS应用在进行小规模内测的时候,如果使用的是99美元的证书,需要把用户的UDID手动加进开发者证书中才能安装。一般情况下我们使用iTunes来查看设备的UDID,但是让目标测试用户操作这一点还是很麻烦的,首先要有装着iTunes的电脑,然后可能还会遇到各种数据线插进去没有反应的情况。使用蒲公英提供的链接,可以直接在iOS设备的Safari中查看UDID。 >>> 阅读全文


默认的UIScrollView滑动到底之后(假设往右),就无法继续往右滑了,但为了更好的用户体验,我们继续往右滑是自动回到第一页。这里提供一个方案。 >>> 阅读全文