Xcode8 Run IOS10 version of the simulator will be a lot of crashes, such as the use of cameras, microphones, health data, etc.

Source: Internet
Author: User
Tags comparison table

Just run the time also feel puzzled, so hang up, Google has just started to solve the problem of camera crash, and later HealthKit problem also understand, originally all only need to fill in info in the corresponding key can be

The correspondence is:

<key>NSCameraUsageDescription</key>
<string>cameraDesciption</string>
<key>NSContactsUsageDescription</key>
<string>contactsDesciption</string>
<key>NSMicrophoneUsageDescription</key>
<string>microphoneDesciption</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>photoLibraryDesciption</string>

Explain these keys.

Nscamerausagedescription-----Camera
Nscontactsusagedescription-----Camera
Nsmicrophoneusagedescription-----Microphone
Nsphotolibraryusagedescription-----Album

There's one more long-healthKit problem.
Collapse in this method:
/*register the type of data you want to read or write, or modify it in the Health app*/[Self.healthstore requestauthorizationtosharetypes:nil readtypes:readdatatypes Completion:^ (BOOL success, Nserror *error) {                if(!success) {NSLog (@"%@\n\n%@", error, [error userInfo]); return ; }                Else                {                    //Dispatch_async (Dispatch_get_main_queue (), ^{//[Self.window.rootViewController PRESENTVIEWCONTROLLER:TABVC animated:yes Completion:nil]; //                });                }            }];

The workaround is to add these two keys:

The following is the official document comparison table, you query the desired key

Xcode8 Run IOS10 version of the simulator will be a lot of crashes, such as the use of cameras, microphones, health data, etc.

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.