iOS8 before you sign up for notifications is
[Application Registerforremotenotificationtypes:uiremotenotificationtypealert| uiremotenotificationtypesound| Uiremotenotificationtypebadge];
iOS8 Register So write
Uiusernotificationsettings *setting = [Uiusernotificationsettings settingsfortypes:uiusernotificationtypealert| uiusernotificationtypebadge| Uiusernotificationtypesound Categories:nil]; [Application registerusernotificationsettings:setting];
About Cllocationmanager
Locationmanager = [[Cllocationmanager alloc] init]; Locationmanager. delegate = self ; [Locationmanager startupdatinglocation];
iOS8 added after the [locationmanager requestalwaysauthorization];
The rest of the content doesn't change. Add two fields to the Info.plist nslocationwheninuseusagedescription and Nslocationalwaysusagedescription
The callback method after positioning is as follows
-(void) Locationmanager: (cllocationmanager *) Manager didupdatelocations: (nsarray *) Locations
In this method, you can get the latitude and longitude control, the location can be geo-coded to get the current position information
Clgeocoder *geocoder =[[Clgeocoder alloc] init]; [Geocoder reversegeocodelocation:newlocation Completionhandler:^ (Nsarray *placemarks, Nserror *error) { for(Clplacemark *placeinchplacemarks) {NSLog (@"name,%@", place.name);//location[manager Stopupdatinglocation]; } }];//about this clplacemark can point in to see/*Including street information can also get @property (nonatomic, readonly, copy) nsdictionary *addressdictionary;//address Dictionary Properties@property (nonatomic, readonly, copy) NSString *name; eg. Apple Inc. @property (nonatomic, readonly, copy) NSString *thoroughfare; Street address, eg. 1 Infinite loop@property (nonatomic, readonly, copy) NSString *subthoroughfare; eg. 1@property (nonatomic, readonly, copy) NSString *locality; City, eg. Cupertino@property (nonatomic, readonly, copy) NSString *sublocality; Neighborhood, common name, eg. Mission District@property (nonatomic, readonly, copy) NSString *administrativearea; State, eg. Ca@property (nonatomic, readonly, copy) NSString *subadministrativearea; county, eg. Santa Clara@property (nonatomic, readonly, copy) NSString *postalcode; Zip code, eg. 95014@property (nonatomic, readonly, copy) NSString *isocountrycode; eg. Us@property (nonatomic, readonly, copy) NSString *country; eg. States@property (nonatomic, readonly, copy) NSstring *inlandwater; eg. Lake Tahoe@property (nonatomic, readonly, copy) NSString *ocean; eg. Pacific Ocean@property (nonatomic, readonly, copy) Nsarray *areasofinterest; eg. Golden Gate Park*/
Push and map modified in iOS8