IOS10 Adaptation and Xcode8 configuration

Source: Internet
Author: User

First, certificate management

After opening the project with Xcode8, it is obvious that this is a new feature of Apple that can help us manage certificates automatically. We recommend that you check this automatically manage signing(Ps.) but in the BEAT2 version I use, completely can not, GM version unexpectedly fantastic and good. )


Let me tell you about the problems that may arise:

1.Xcode without a developer account set


qq20160913-0.png-38.5kb


The solution is: everyone in the Xcode preferences, add an Apple account, you can.

2. The device machine is not added to the developer's device.


qq20160913-2.png-33.7kb


The solution is: everyone in the official website to add the device into the development machine, accompany the description file to re-next description file.

3. Normal situation: Xcode Configure the image after login to the developer account, wait patiently.


qq20160913-1.png-25.1kb


Diagram after waiting for completion


qq20160913-3.png-27kb

Ii. Considerations for Xib Documents

After you use Xcode8 to open the Xib file, a prompt appears.



You can choose Choose Device.
Then everyone will find the layout ah, frame chaos, only need to update frame. Such as


    • Note: If you follow the above steps and open xib with Xcode7, the error will be reported.

    • Workaround: Need to delete xib inside
      <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
      This, as well as changing the version in < document > ToolsVersion and < plugIn > to the value in your normal xib file
      , but it is not recommended to do so, after Xcode8 out, I hope we all quickly get started, full update. This is the same as XCODE5 to Xcode6, there are changes, but still want to learn as soon as possible, adapt Yo!

Third, code and API note

After using Xcode8, some of the code may not be compiled, specifically I would like to talk about the problems I encountered.
Proxy method for 1.UIWebView:
* * Note to delete Nserror in front of the nullable, otherwise error.

-(void) WebView: (UIWebView *) WebView didfailloadwitherror: (Nullable nserror *) error{    [self hidehud];}

  

Iv. Workarounds for code annotations not available

This is because Apple solves Xcode ghost and blocks the plugin.
Workaround
Open terminal, command run: sudo/usr/libexec/xpccachectl
Then you have to restart the computer to take effect

Note: The Xcode8 has a built-in annotation feature, where


The shortcut keys are set here


Seemingly Xcode8 canceled the function of the three-party plug-in, specific can refer to the next Xcode8 Source Editor

V. Permissions and Related Settings

Note that when added, there is no space at the end
We need to open the Info.plist file to add a description of the appropriate permissions, or the program will crash on IOS10.
Specific example:


Microphone Permissions: Privacy-microphone usage Description Do you want to allow this app to use your microphone?
Camera permissions: Privacy-camera usage Description Do you want to allow this app to use your camera?
Album Permissions: Privacy-photo library Usage Description Do you want to allow this app to access your media library? Address Book permissions: privacy-contacts Usage Description Do you want to allow this app to access your contacts?
Bluetooth permissions: Privacy-bluetooth Peripheral usage Description Do you Xu Yun this app to use Bluetooth?

Voice to text permissions: Privacy-speech recognition usage Description allow this app to use speech recognition?
Calendar permissions: Privacy-calendars usage Description Do you want to allow this app to use the calendar?

Location permissions: Privacy-location when on use Usage Description we need to get relevant data about you from your location
Location rights: Privacy-location always Usage Description We need to get data about you from your location
The positioning needs to be written so as to prevent the shelves from being rejected.

Six, the font becomes larger, the original frame needs to fit

After some friends remind, found that the original 2 words in the program width is 24, now 2 words need 27 width to show.
Hope to have a solution to the friend, comments sue me yes, thank you

Seven, push to send

such as the section, do not forget to open. All the push platform, whether it is the aurora or what, to receive the push, this must be opened yo??


After that, you should be able to receive the push. In addition, the Aurora Push also launched a new version, you can also update.

PS. Apple has made a lot of changes to the push, I hope that we have more access to review, processing the agent method of push has changed.

// 推送的代理[<UNUserNotificationCenterDelegate>]

IOS10 received notification is no longer in
[application: didReceiveRemoteNotification:]method to deal with, IOS10 launches new proxy method, receives and processes various notifications (local or remote)

-(void) Usernotificationcenter: (unusernotificationcenter *) Center willpresentnotification: (unnotification *) Notification Withcompletionhandler: (void (^) (unnotificationpresentationoptions)) Completionhandler {//app receives notification at foreground NSLog (@ "========%@", notification);} -(void) Usernotificationcenter: (unusernotificationcenter *) Center Didreceivenotificationresponse: ( Unnotificationresponse *) Response Withcompletionhandler: (void (^) ()) Completionhandler {//Click notification to enter App NSLog (@ "Response: %@ ", response);}

  

I will update the article later and give a detailed explanation of the push.

Eight, shielding the messy bug

After updating the Xcode8, the newly created project will print a bunch of logs that are inexplicable to read.
such as these

0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1,

The shielding method is as follows:
Xcode8 inside Edit scheme-> Run--Arguments, in the environment variables inside add
Os_activity_mode = Disable


If you have written or printed log, please check the checkmark again, you can solve the

Ps. Considering the addition of the above content after Xcode8, the real machine debugging may have an exception, you can customize a macro definition, to do the log output.

#ifdef debug#define ddlog (...) printf ("%s\n", [[NSString stringwithformat:__va_args__]utf8string]); #define Ddlog_ Current_method NSLog (@ "%@-%@", Nsstringfromclass ([Self class]), Nsstringfromselector (_cmd)) #else # define Ddlog (...); #define Ddlog_current_method; #endif

 

References (stamp here):

> Http://www.jianshu.com/p/66bc16b872d7

> HTTP://WWW.JIANSHU.COM/P/9756992A35CA

> http://bbs.520it.com/forum.php?mod=viewthread&tid=2250

IOS10 Adaptation and Xcode8 configuration

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.