_BSMachError: (os/kern) invalid name (15)
_BSMachError: (os/kern) invalid capability (20)解决方法
在程序运行的时候,如果点击文本框,键盘弹出,则会在控制台打印出如下警告:
_BSMachError:(os/kern) invalid capability(20)
_BSMachError:(os/kern) invalid name(15)
以上警告是在Xcode7.1以上版本中才会出现的警告,解决方法:
在工程的info.plist文件中添加如下内容:
[html]
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>testdomain.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<false/>
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.2</string>
<key>NSExceptionRequiresForwardSecrecy</key>
<true/>
<key>NSIncludesSubdomains</key>
<false/>
<key>NSRequiresCertificateTransparency</key>
<false/>
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
<false/>
<key>NSThirdPartyExceptionMinimumTLSVersion</key>
<string>TLSv1.2</string>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<true/>
</dict>
</dict>
</dict>