iOS 9 SDK Summary

Source: Internet
Author: User

One: nsapptransportsecurity

IOS9 let all http default HTTPS, the original HTTP protocol transfer is changed to TLS1.2 protocol for transmission. The direct result is that when the app sends a request, the network fails to connect. The solution is to add the following node to the project's Info.plist file:

This sub-node means: whether to allow wayward loading?! Set to Yes will disable the apptransportsecurity switch to user-defined settings, which solves the problem

It says that Apple restricts the HTTP protocol, but it doesn't mean that all https is perfectly suited to iOS9.

For example, load WebView

Load https://github.com/

Load https://baidu.com/

GitHub Web page can open, Baidu's Web page cannot open, the following print a line of log

The reason is that Apple's official profile says it must first be based on the TLS 1.2 version agreement. Then the cryptographic algorithm of the certificate also needs to reach the RSA key or ECC key of SHA256 or higher, and if it does not, the request is interrupted and nil is returned.

In the browser is can directly see this website encryption algorithm, first point green Lock point certificate information.

The situation for Baidu can be configured in Info.plist as follows, if the site reference more than should be required for each site configuration.

Nsapptransportsecurity,nsexceptiondomains,nsincludessubdomains,nsexceptionrequiresforwardsecrecy, Nsexceptionallowinsecurehttploads is written below for easy copying.

Second, Bitcode

Bitcode's understanding should be to compile the program into a transition code, and then Apple to compile the transition code into an executable program. Bitcode also allows Apple to re-optimize our program binaries in the late stages, with ideas like app slimming.

The following error may occur with the Xcode7 compiler to compile items that are not problematic before compiling.

XXXX’ does not contain bitcode. You must rebuild it withbitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. forarchitecture arm64

The problem is due to the fact that some third-party libraries do not yet support Bitcode. Otherwise, wait for the library developers to upgrade this feature we update the library, or to disable this bitcode.

The disabled method is to find the following configuration, select No. (iOS Bitcode is the default Yes,watchos in Bitcodes is not allowed to change must be yes.) )

Third, set up trust

This article is only relevant to enterprise applications or inhose, not to the application of AppStore channels.

In iOS8 just pop up a window asking if you need to let the phone trust this app, but in iOS9 but directly banned, if you really want to trust yourself need to manually open. Similar to the MAC system downloaded from unknown developers, DMG directly will not open, and then to the system preferences of security and privacy manually opened. Show left IOS8, right iOS9

Users need to go to set---"General---" in the description file to add their own trust.

There are two ways to deal with this problem: 1. Do not upgrade IOS9 2. Most of the company employees use enterprise-class applications, mass a guidance mail.

Four, font

IOS8, the font is Helvetica, the Chinese font is a bit similar to "Chinese fine black". It's just that the iphone comes with its own rendering, so it may look more beautiful than ordinary Chinese. In IOS9, the Chinese system font has become a Chinese-designed "apple" is a bit like a word font "young circle". The font has a slight bold effect, and the most important thing is that the font gap gets bigger!

So many of the labels that were originally written to the width may appear "...".

Five, URL scheme

The scenario used by URL scheme is that the application has the ability to share or jump other platform licenses, share or authorize and then jump back.

There are not too many restrictions on iOS8, but iOS9 need to whitelist the URL scheme you want to call outside to complete the jump

If IOS9 does not make the appropriate match, it will report the following error

canOpenURL: failed forURL : "mqzone://qqapp"- error: "This app is not allowed to query for scheme mqzone"

The specific solution is to set the Lsapplicationqueriesschemes type to an array in Info.plist, and add all of the schemes you use below

Liu, StatusBar

This is good just to report a warning, if it is regardless of him, there will be no problem.

: Cgcontextsavegstate:invalid context 0x0. If you want to see the backtrace, please set cg_context_show_backtrace environmental variable.

We used to be able to control the style of the top statusbar in real-time, we might like to use

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent] [[UIApplication sharedApplication]setStatusBarHidden:YES];

But before doing so need to add the info.plist inside the view controller-based status bar appearance bool value set to No, that is, the Controller control status bar permissions to prohibit, with the uiapplication to control. However, this practice is not recommended in iOS9, we recommend that we use the BOOL value is set to Yes, and then use the controller to manage the status bar such as.

- (UIStatusBarStyle)preferredStatusBarStyle { return  UIStatusBarStyleLightContent; }

The point in the header file can verify just the saying:

@property(readwrite, nonatomic,getter=isStatusBarHidden) BOOL statusBarHidden NS_DEPRECATED_IOS(2_0, 9_0, "Use -[UIViewController prefersStatusBarHidden]");

Seven, Didfinishlaunchingwithoptions

If you report the following error when you run it, your didfinishlaunchingwithoptions is wrong.

***** Assertion failure in-[UIApplication _runWithMainScene:transitionContext:completion:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3505.16/UIApplication.m:3294**

IOS9 does not allow the Rootviewcontroller of Windows to be set after Didfinishlaunchingwithoptions is finished. Perhaps the Xcode7 compiler itself does not support it.

The solution, of course, is to initialize the values first, and then replace them with the values.

UIWindow *window = [[UIWindowalloc] initWithFrame:[UIScreenmainScreen].bounds]; window.rootViewController = [[UIViewController alloc]init];

Eight, TableView

Although the current iOS9 has been pushed to the official version, but iOS9 use will still feel the app more than ever, TableView drag when the most obvious lag display. And before encountering a bug, the original Good project with Xcode7 a compile, tableView refresh the problem, [TableView Reloaddata] Invalid there is a row of cells clearly changed but not to refresh. The feeling may be that this method conflicts with some of the new features, and it may be that the reloaddata operation is deferred until the next Runloop execution is final.

The solution is to comment [TableView Reloaddata], instead of local refresh, the problem actually solved.

[Self.tableview Reloadsections:[nsindexset indexsetwithindex:0] withrowanimation:uitableviewrowanimationnone];

Temporarily encounter these problems, feel iOS9 of the emergence of all iOS development is a tight, hope that Apple this drastic change, maverick style development after not and government contradictions, and then the company closed down led to the development of unemployment, perhaps I think more. I wish all iOS can be timely to do a good job to change the bug, the next version of the line, all problems are resolved.

iOS 9 SDK Summary

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.