iOS8 location issues, as well as a direct crash on iphone Click Set Privacy targeting feature

Source: Internet
Author: User

iOS8 positioning problem Solving ideas:

1, plist File New add two variables:

A, nslocationalwaysusagedescription=yes; B, Nslocationwheninuseusagedescription=yes

2, increase the judgment whether the mobile phone for the iOS8 system, plus permissions

Locationmanager = [[Cllocationmanager alloc] init];
Locationmanager.delegate = self;
Locationmanager.distancefilter = Kcldistancefilternone;
Locationmanager.desiredaccuracy = Kcllocationaccuracybest;
if (IOS8) {
[Locationmanager requestalwaysauthorization];//always
[Locationmanager requestwheninuseauthorization];//during use//or
}
[Locationmanager startupdatinglocation];

3, increase the agent method:

-(void) Locationmanager: (Cllocationmanager *) Manager didchangeauthorizationstatus: (clauthorizationstatus) status
{
Switch (status) {
Case kclauthorizationstatusnotdetermined:
if ([Locationmanager respondstoselector: @selector (requestalwaysauthorization)])
{
[Locationmanager requestwheninuseauthorization];
}
Break
Default
Break
}

} iOS8 System Click to set the privacy location function directly crashes the problem of this issue is certainly not the problem of iOS8 system, because other apps are good, why your app is a problem, it must be when you add code when the wrong place. I searched the code several times, and finally found that there is a place different from others, that is, when setting the plist file variable type bool should be a string. It is estimated that the apple is judged by a string comparison, so the bool type collapses directly.


iOS8 location issues, as well as a direct crash on iphone Click Set Privacy targeting feature

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.