XCODE6 compilation IOS8 cannot be located solve the problem

Source: Internet
Author: User

Because there are two new methods in IOS8 's positioning:

-  (void) requestwheninuseauthorization __osx_available_starting (__mac_na, __iphone_8_0);-  ( void) requestalwaysauthorization __osx_available_starting (__mac_na, __iphone_8_0); If you need to locate only in the foreground, You need to call requestwheninuseauthorization  before calling startupdatinglocation   if you need to locate in front of the background, You need to call requestalwaysauthorization  before calling startupdatinglocation   Add the Nslocationwheninuseusagedescription or Nslocationalwaysusagedescription fields to the plist file at the same time the values of the two fields should be set to the Yes code reference in the next:-( void)  initlocation {    self.locationmanager=[[cllocationmanager alloc]  init];    self.locationManager.delegate=self;     Self.locationmanager.desiredaccuracy=kcllocationaccuracynearesttenmeters;    if ( Isios8later) {        [self.locationmanager  requestalwaysauthorization];    }    [self.locationmanager  Startupdatinglocation];}

This article is from the "iOS Development Manor" blog, make sure to keep this source http://macho.blog.51cto.com/8652974/1557376

XCODE6 compilation IOS8 cannot be located solve the 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.