IOS development is compatible with iOS10, Xcode8, and ios10xcode8

Source: Internet
Author: User

IOS development is compatible with iOS10 and Xcode8 [conversion], and ios10xcode8

Now on Apple's official website, we can download the GM version of Xcode8. In addition, in the early morning of November 9.14, Apple will officially launch the iOS10 system push, the adaptation of iOS10 is imminent. I don't know the Xcode8 beat version. How can I download some of my shoes? As far as my use is concerned, I feel that Apple is still in the trap, but it is still improving. Next I will talk about iOS10 adaptation and some notes on Xcode8 usage.

I. Certificate Management

After opening the project with Xcode8, it is obvious that this is a new feature of Apple, which can help us automatically manage certificates. We recommend that you check thisAutomatically manage signing(Ps. But when I use the beat2 version, it's totally unavailable. The GM version is amazing .)


Below I will talk about possible problems:

1. If no developer account is set for Xcode



Solution: add an apple account in Xcode preference settings.

2. If the Device machine is not added to the developer's Device


 


Solution: add the device to the development machine on the official website and use the description file to re-create the description file.

3. Normal condition: configure the image after logging on to the developer account in Xcode and wait patiently.



Figure after completion


Ii. Precautions for Xib files

When Xcode8 is used to open the xib file, a prompt is displayed.


 


Select Choose Device.
Later, you will find that the layout is messy. You just need to update the frame. For example


  • Note: If you follow the steps above, an error will be reported when you use Xcode7 to open Xib,

  • Solution: Delete the Xib file.
    <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
    In this case, change the toolsVersion in <document> and the version in <plugIn> to the value in your normal xib file.
    But we do not recommend that you do this. After Xcode8 is released, we hope everyone can get started quickly and update all the users. This is the same as that between Xcode5 and Xcode6, but we still need to learn it as soon as possible and adapt to it as soon as possible!
Iii. Code and Api considerations

After Xcode8 is used, some code may not be compiled. Let me talk about the problems I encountered.
1. Proxy method of UIWebView:
** Delete the nullable before NSError. Otherwise, an error is returned.

- (void)webView:(UIWebView *)webView didFailLoadWithError:(nullable NSError *)error{    [self hideHud];}
Iv. Solutions to code comments that cannot be used

This is because Apple solved xcode ghost and blocked the plug-in.
Solution
Open the terminal and run the following command: sudo/usr/libexec/xpccachectl
Then it takes effect after the computer is restarted.

Note: Xcode8 has the built-in function of enabling annotation, which is located here.


The shortcut key is set here.
It seems that Xcode8 has canceled the third-party plug-in function. For details, refer to Xcode8 Source Editor v. permissions and related settings.

Note: do not include spaces at the end of the add
You need to open the info. plist file and add the corresponding permissions. Otherwise, the program will crash on iOS10.
For example:


 

Microphone permission: Privacy-Microphone Usage Description allow this App to use your Microphone?
Camera permission: Privacy-Camera Usage Description allow this App to use your Camera?
Album permission: Privacy-Photo Library Usage Description: Does this App allow access to your media repository? Address book permission: Privacy-Contacts Usage Description: can this App access your address book?
Bluetooth permission: Privacy-Bluetooth Peripheral Usage Description: Do you want to allow this App to use Bluetooth?

Permission for converting Speech to text: Privacy-Speech Recognition Usage Description: can this App use Speech Recognition?
Calendar permission: Privacy-Calendars Usage Description: can this App use calendar?

Permission: Privacy-Location When In Use Usage Description we need to obtain the relevant data around you through your geographic Location information
Permission: Privacy-Location Always Usage Description we need to obtain the relevant data around you through your geographic Location information
You need to write this information to prevent rejection of mounting.

6. The font becomes larger and the original frame needs to be adapted.

Some friends reminded me that the original width of the two words in the program is 24, and now the two words need the width of 27 to display ..
If you want a solution, please comment on me. Thank you.

VII. Push

For example, do not forget to open. All push platforms, whether Aurora or anything, must be opened to receive the push.


Then you can receive the push. In addition, Aurora push has released a new version, which can be updated.

PS. Apple has made great changes to push this time. I hope you can check it out more and the proxy method for processing push has also changed.

// Push proxy [<UNUserNotificationCenterDelegate>]

IOS10 no longer receives notifications
[application: didReceiveRemoteNotification:]IOS10 introduces a new proxy method to receive and process various notifications (local or remote)

-(Void) userNotificationCenter :( UNUserNotificationCenter *) center willPresentNotification :( UNNotification *) notification withCompletionHandler :( void (^) (UNNotificationPresentationOptions )) completionHandler {// The application receives a notification NSLog (@ "=========%@", notification) ;}- (void) userNotificationCenter :( UNUserNotificationCenter *) on the frontend *) center didReceiveNotificationResponse :( UNNotificationResponse *) response withCompletionHandler :( void (^) () completionHandler {// click the notification to enter the application NSLog (@ "response: % @", response );}

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

8. Block disorganized bugs

After Xcode8 is updated, the newly created Project will print a bunch of unintelligible logs.
Such

subsystem: com.apple.UIKit, category: HIDEventFiltered, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1,

The blocking method is as follows:
Edit Scheme-> Run-> Arguments in Xcode8, and add
OS _ACTIVITY_MODE = Disable


If you still print logs after writing them, check the check box again to solve the problem.

 

Text/Xu different (simplified author)
Link: http://www.jianshu.com/p/9756992a35ca

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.