iOS development-solve Baidu map simulator can't locate problem

Source: Internet
Author: User

When using Baidu Map to locate on the simulator, often reported such errors:

This function is called when the/*** location fails * @param error number */-(void) Didfailtolocateuserwitherror: (Nserror *) Error{nslog (@ "%@", error);// Error Domain=kclerrordomain code=0 "The operation couldn ' t be completed. (kclerrordomain error 0.) "}


At first, I doubted that the simulator could not be located. However, the Baidu Map SDK does provide a static library of the simulator, indicating that it should be available.

Toss a bit, found that I did not open the location function. It's silly.


Generally there are 2 questions:

1. Simulator does not turn on function



The default location option is None, set it up just fine.



2. Application not authorized

The first time you open the app, you'll be asked if you want to allow the location feature ...

If you choose to reject it, you cannot locate it naturally.

Workaround:

1. Reset Simulator ... Compare violence

2. Go to Settings--Privacy---> set it up.

iOS development-solve Baidu map simulator can't locate problem

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.