IOS10 fit and Xcode8 use the pits that need attention _ios

Source: Internet
Author: User

Now in Apple's official online, we can download to the GM version of Xcode8, plus 9.14 early in the morning, Apple will officially launch the IOS10 system of the push, at this juncture, iOS10 adaptation is imminent, do not know Xcode8 beat version, Children's shoes have wood download come and try? As far as my use is concerned, the overall feeling is that the apple is still in the pit, but it has been improving. Let me just say, iOS10 and Xcode8 use some of the attention points.

First, certificate management

After opening the project with Xcode8, it is obvious that the following figure, this is Apple's new features, can help us automate the management of certificates. We recommend that you tick this automatically manage signing (Ps. But in the BEAT2 version of the time I used, completely can not, GM version unexpectedly wonderful again. )

Let me say a few questions that may arise:

1.Xcode screenshot with no developer account set


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

2. A screenshot of the device machine not added to the developer's device

The solution is: everyone in the official website to add the device into the development machine, accompanied by the description of the file can be described again.

3. Normal situation: Xcode configuration Login Developer account after the picture, patiently waiting.

Figure after waiting to finish

Ii. Notes on Xib documents

When you open the Xib file using Xcode8, the following illustration appears.


We choose choose Device can be.
Then you will find the layout ah, frame chaos, only need to update the frame can be. The following figure

Note: If you follow the steps above, when you open the Xib with Xcode7, you will report an error.

Solution: Need to delete xib inside
<capability name= "Documents saved in the Xcode 8 format" mintoolsversion= "8.0"/>
This sentence, and change the version in ToolsVersion and < plugIn > in < document > to the values in your normal xib file
, but do not recommend this, after Xcode8 out, I hope everyone is quick to start, full update. This is the same as XCODE5 to Xcode6, there are changes, but still need to learn as soon as possible, adapt Yo!

Third, code and API attention

After using Xcode8, some of the code may not be compiled, specifically I would like to say that I encountered problems.

1.UIWebView Proxy Method:
* * Note to delete the Nserror front of the nullable, otherwise the error.

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


Four, code comments can not be used to solve the solution

This is because Apple solves Xcode ghost and shields the plugin.
Solving method
Open Terminal, command run: sudo/usr/libexec/xpccachectl
Then you must reboot the computer to take effect.

Note: The Xcode8 is built with the ability to open annotations, located here

The shortcut keys are set here

Seemingly Xcode8 canceled the function of the three-party plug-ins, specific can be consulted under Xcode8 Source Editor

V. Permissions and Related Settings

Note that when you add, there are no spaces at the end.
We need to open the Info.plist file to add a description of the appropriate permissions, otherwise the program will crash on the iOS10.
The following figure:

Microphone Permissions: Privacy-microphone Usage Description allow this app to use your microphone?
Camera permissions: Privacy-camera Usage Description allow this app to use your camera?
Album Permissions: Privacy-photo library Usage Description allow this app to access your media database? Address Book permissions: Privacy-contacts Usage Description allow this app to access your address Book?
Bluetooth permissions: Privacy-bluetooth peripheral Usage Description Xu Yun This app to use Bluetooth?

Voice-text permissions: Privacy-speech recognition Usage Description allow this app to use speech recognition?
Calendar permissions: Privacy-calendars Usage Description allow this app to use the calendar?

Location permissions: Privacy-location when in the use Usage Description we need to obtain information about your surroundings through your geographic location
Location permissions: privacy-location Always Usage Description We need to obtain information about your surroundings through your geographic location.
Positioning needs to be so written to prevent the shelves from being rejected.

Six, the font size, 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 the.
Hope to have a solution friend, comment on me yes, thank you

Vii. Push and send

Don't forget to open the part of the diagram below. All push platform, no matter is the aurora or what, want to receive push, this is must open yo ✌️

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

PS. Apple this time on the push has made a great change, I hope that we read more lookup, processing the agent method of push also changed.

Push Agent
[<unusernotificationcenterdelegate>]

IOS10 received a notice no longer in the

[Application:didreceiveremotenotification:] method to deal with, iOS10 introduce new agent methods, receive and process various notifications (local or remote)

Copy Code code as follows:
-(void) Usernotificationcenter: (unusernotificationcenter *) Center willpresentnotification: (unnotification *) Notification Withcompletionhandler: (void (^) (unnotificationpresentationoptions)) Completionhandler {//application received notification in the foreground NSLog (@ "========%@", notification);} -(void) Usernotificationcenter: (unusernotificationcenter *) Center Didreceivenotificationresponse: ( Unnotificationresponse *) Response Withcompletionhandler: (void (^) ()) Completionhandler {//Click on notification to enter application NSLog (@ "Response: %@ ", response);}

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

8. Screen the messy bugs

After the Xcode8 is updated, the new project will print a bunch of log that inexplicably can't read.
such as these

Subsystem:com.apple.UIKit, category:hideventfiltered, enable_level:0, persist_level:0, default_ttl:0, info_ttl:0, de bug_ttl:0, generate_symptoms:0, Enable_oversize:1,

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

If you print the log after you have written it, check the check again, and you can solve the

Ps. Considering adding the above content in the Xcode8, the real machine debugging may be abnormal, you can customize a macro definition, to do 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

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

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.