IOS 9 Adaptation

Source: Internet
Author: User

Reference: http://blog.csdn.net/lvxiangan/article/details/48675881

1. Use HTTPS requests by default

If the HTTP request was used before Xcode 9, then the app compiled on Xcode 9 is not networked, prompting the following error:

APP Transport Security has blocked a cleartext HTTP (/HTTP) resource load since it is insecure. Temporary exceptions can be configured via your app ' s info.plist file.

Workaround:

1. Enable the server to support HTTPS access

2. Turn off the use of HTTPS

The first approach is relatively expensive for individual developers, so the latter approach is recommended, specifically: Add the Nsapptransportsecurity dictionary type to the project's Info.plist file, add an element: Key is Nsallowsarbitraryloads, and the value is yes.

<key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><  True/></dict>

2. IOS 9 Use URL scheme to whitelist it

You will be prompted with an error similar to the following:

canopenurl:failed for URL: "Mqqopensdkapiv2://qqapp"-Error: "The This app isn't allowed to the query for scheme MQQOPENSDKAPIV 2 "

Workaround:

The Info.plist file adds an array value of key Lsapplicationqueriesschemes, which contains the string type scheme for which you want to add a white list.

<key>LSApplicationQueriesSchemes</key><array>    <string>xxxx schema</  String></array>

3. Bitcode

Use Xcode7 to compile hints: XXX does not contain bitcode. You must rebuild it with Bitcode enabled (Xcode setting Enable_bitcode), obtain a updated library from the vendor, or dis Able Bitcode for this target. For Architecture arm64

Bitcode is an intermediate form of code that is compiled by a program. Programs that contain Bitcode configuration will be compiled and linked on the App store. Bitcode allows Apple to re-optimize the binaries of our program at a later stage without requiring us to resubmit a new version to the App Store.

Xcode7 The Bitcode is turned on by default, if the app uses a third-party class library that does not support Bitcode, it prompts for an error, just close Bitcode in the Enable bitcode option of Build Settings.

When Bitcode compilation is turned on, the resulting file size becomes larger (because it is an intermediate code, not a user-downloaded package), and the dSYM file cannot be used to symbolize the crash log (the package that the user downloads is generated by the Apple service recompilation and generates a new symbol file). By uploading the AppStore package in archive mode, you can download the new symbol file for the installation package in the Xcode Organizer tool.

4. Use XCode7 to link third-party library tips Warning

Lots of warnings when building with Xcode 7 and 3rd party libraries
Warning:could not resolve external type C:OBJC (CS) nsstring
Warning:could not resolve external type C:OBJC (CS) nsdictionary
Warning:could not resolve external type C:OBJC (CS) nsmutablestring
Warning:could not resolve external type C:OBJC (CS) nserror
https://forums.developer.apple.com/thread/17921
There is no good solution at the moment, you can try the following:
I had this problem too. Here's how I fixed it.
1) Go to build Settings, build Options, Debug information Format
2) Change the Debug setting from ' DWARF with DSYM File ' to ' DWARF '
3) Leave the Release setting at "DWARF with DSYM File"
The problem appears to is that Xcode is trying to create DSYM files for Debug builds. You don ' t need DSYM files for Debug builds--it's release builds where you need them.

IOS 9 Adaptation

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.