Before IOS8, just
#import <CoreLocation/CoreLocation.h> introduction of Corelocation.framework.
@property (nonatomic, strong) Cllocationmanager *locationmanager;
You can use location information.
After IOS8, Apple has made some modifications to the positioning, including the method of locating authorization, Cllocationmanager adds the following two methods:
(1) Always allow access to location information
- (void)requestAlwaysAuthorization;
(2) Allow access to location data during use of the application
- (void)requestWhenInUseAuthorization;
Examples are as follows:
Self.locationmanager = [[Cllocationmanager Alloc]init];_locationmanager. delegate ==ten; [ _locationmanager Requestalwaysauthorization]; // Add this sentence [_locationmanager startupdatinglocation];
Reprinted from: http://blog.devzeng.com/blog/ios8-corelocation-framework.html
[Reprint]IOS9 Use Corelocation