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