IOS development for IOS 10 and xcode8
IOS development: adapt to ios10 and xcode8
Now on Apple's official website, we can download the GM version of xcode8. In the early morning of September 14, Apple will officially launch the push of ios10 system. At this time, the adaptation of ios10 is imminent. I don't know the xcode8 beat version. Do children's shoes download it? As far as my use is concerned, I think apple is still in trouble, but it is also improving all the time. Let me talk about the adaptation of ios10 and some points for attention in the use of xcode8.
1、 Certificate management
After opening the project with xcode8, the following figure is obvious. This is a new feature of apple, which can help us automatically manage certificates. It is recommended that you check this automatically manage signing (Ps. but when I use the beat2 version, it is completely impossible. The GM version is miraculously good.)
Let me talk about the possible problems:
1. Screenshot of Xcode without developer account
The solution is: you can add an apple account in Xcode's preferences.
2. Screenshot when the device machine is not added to the developer's device
The solution is: after adding the equipment to the development machine on the official website, you can accompany the description file to the next description file.
3. Normal condition: Xcode configures the picture after logging in the developer account, and just wait patiently.
Figure after waiting for completion
2、 Notes for Xib files
After opening the Xib file with xcode8, the following prompt will appear.
You can select choose device. After that, you will find that the frame is disordered. You only need to update the frame. As shown below
Note: if you open Xib with xcode7 after following the above steps, an error will be reported,
Solution: you need to delete Xib
< capability name = "documents saved in the Xcode 8 format" mintoolsversion = "8.0" / > this sentence, and change the toolsversion in < document > and the version in < plugin > to the value in your normal Xib file, but it is not recommended. After xcode8 comes out, I hope everyone can start it quickly and update it. This is the same as xcode5 to xcode6. There are changes, but we should learn as soon as possible and adapt as soon as possible!
3、 Code and API notes
After using xcode8, some code may not compile. I'll talk about the problems I encountered.
1. Uiwebview proxy method: * * Note: delete nullable in front of nserror, otherwise an error will be reported.
4、 A solution to the problem that code comments cannot be used
This is because Apple solved Xcode ghost and blocked the plug-in. Solution: open the terminal, run the command sudo / usr / libexec / xpccachectl, and then restart the computer to take effect
Note: xcode8 has a built-in function to open comments, which is located here
The shortcut keys are set here
It seems that xcode8 cancels the function of three-party plug-ins. For details, please refer to xcode8 source editor
5、 Permissions and related settings
Note that when adding, there should be no space at the end. We need to open info Plist file adds the description of the corresponding permission, otherwise the program will crash on ios10. See the following figure for details:
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 library? Address book permissions: privacy - contacts usage description allow this app to access your address book? Bluetooth permission: privacy - Bluetooth universal usage description allow this app to use Bluetooth?
Voice to text permission: privacy - speech recognition usage description allow this app to use speech recognition? Calendar permission: privacy - calendars usage description allow this app to use calendar?
Location permission: privacy - location when in use usage description we need to obtain the relevant data around you through your geographic location information. Location permission: privacy - location always usage description we need to obtain the relevant data around you through your geographic location information. We need to write this to prevent being rejected on the shelf.
6、 The font becomes larger and the original frame needs to be adapted
Reminded by some friends, I found that the original width of 2 words in the program is 24, and now 2 words need a width of 27 to display.. Hope to have a solution friends, comment on me, thank you
7、 Push
As shown in the figure below, don't forget to open it. All push platforms, whether aurora or something, must be turned on if they want to receive push ✌️
Then you should be able to receive the push. In addition, Aurora push has also launched a new version, and you can also update it.
PS. Apple has made great changes to push this time. I hope you can check it more. The agent method for handling push has also changed.
I will update the article later to explain push in detail.
VIII Shield messy bugs
After updating xcode8, new projects will print a bunch of inexplicable logs Such as these
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 shielding method is as follows: edit scheme - > Run - > arguments in xcode8, and add OS in environment variables_ ACTIVITY_ MODE = Disable
If the log is still printed after writing, please check again to solve the problem
Sina Weibo: Wang Bin SVIP email: wangbin47@huawei.com Apple email: wb514apple@icloud.com github:WBcodeing
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.