A variety of problems in iOS9 adaptation

Source: Internet
Author: User

1, HTTP on the iOS9 can not be used, need to configure,

The resource could not being loaded because the app transport security policy requires the use of a secure connection

The resource cannot be loaded because the application transmits a security policy that requires the use of a secure connection

IOS9 introduced the new feature app Transport Security (ATS). Details: App Transport Security (ATS)

The new feature requires that the network access within the app must use the HTTPS protocol. This means that the API interface must be HTTPS later
But now the company's project is using the HTTP protocol, using private encryption to ensure data security. It is not immediately possible to change to HTTPS protocol transfer.

Temporary workaround:

Add the Nsapptransportsecurity type dictionary in Info.plist.
Add Nsallowsarbitraryloads type Boolean under Nsapptransportsecurity with the value set to Yes

2, TableView
Originally good project with Xcode7 a compile, tableView refresh out 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];

3. 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.
Users need to go to set---"General---" in the description file to add their own trust.


4. Directory not found for option problem

The warning is as follows:
Ld:warning:directory not found for option '-f/applications/xcode 7.app/contents/developer/platforms/ Iphonesimulator.platform/developer/sdks/iphonesimulator9.0.sdk/developer/library/frameworks '

Cause of the problem: Xcode7 changed the Framworks position.
Workaround:
Click Project, select Targets->xxxtests
Select Build setting to find Frameworks search Path and Library search Paths
Delete $ (sdkroot)/developer/library/frameworks,
or replace with $ (platform_dir)/developer/library/frameworks

5. Changes in Uistatusbarstyle

Project operation error is as follows

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



Error Reason: Set the app's status bar style using the old way, in Info.plist set the view controller-based status bar appearance to No, the default is yes, the general type of iOS6 use this way, ios7,8 is also compatible, but by the iOS9 the warning was reported.

[[UIApplication sharedapplication]setstatusbarstyle:uistatusbarstylelightcontent];

We used to change the state of the color through the above code, iOS9 later to see the API found the following description

Setting The Statusbarstyle does nothing if your application is using the default uiviewcontroller-based status bar Syst Em.
@property (ReadWrite, nonatomic) uistatusbarstyle Statusbarstyle Ns_deprecated_ios (2_0, 9_0, "use-[uiviewcontroller Preferredstatusbarstyle] ");
-(void) Setstatusbarstyle: (Uistatusbarstyle) Statusbarstyle animated: (BOOL) animated Ns_deprecated_ios (2_0, 9_0, "use -[uiviewcontroller Preferredstatusbarstyle] ");

Workaround:
Modify the mode to set the view controller-based status bar appearance to Yes, and then use the new way to implement the style of the status bar.

-(Uistatusbarstyle) Preferredstatusbarstyle;
-(Uiviewcontroller *) Childviewcontrollerforstatusbarstyle;
-(void) setneedsstatusbarappearanceupdate


6. Bitcode problem (Popular explanation: Online version of Android art mode)
The error is as follows

Ld:warning:directory not found for option '-f/applications/xcode.app/contents/developer/platforms/iphoneos.platform /developer/sdks/iphoneos9.0.sdk/developer/library/frameworks '
LD:-bundle and-bitcode_bundle (Xcode setting Enable_bitcode=yes) cannot be used together
Clang:error:linker command failed with exit code 1 (use-v to see invocation)
Bitcode Error

Cause: Xcode7 and above will turn on Bitcode by default.
Bitcode What is specific is not explained.

Workaround:
1. Update the library to include Bitcode, otherwise the above problems will occur.
2. Close the Bitcode, simple and rude.

Build Settings "," Enable Bitcode "to" NO ".

A variety of problems in iOS9 adaptation

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.