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