@@ -115,35 +115,20 @@ - (void)addBlockForCurrentLocation:(PFLocationManagerLocationUpdateBlock)handler
115
115
#pragma mark - CLLocationManagerDelegate
116
116
// /--------------------------------------
117
117
118
- // TODO: (nlutsenko) Remove usage of this method, when we drop support for OSX 10.8
119
- #pragma clang diagnostic push
120
- #pragma clang diagnostic ignored "-Wdeprecated-implementations"
121
- - (void )locationManager : (CLLocationManager *)manager
122
- didUpdateToLocation : (CLLocation *)newLocation
123
- fromLocation : (CLLocation *)oldLocation {
118
+ - (void )locationManager : (CLLocationManager *)manager didUpdateLocations : (NSArray *)locations {
119
+ CLLocation *location = [locations lastObject ];
120
+
124
121
[manager stopUpdatingLocation ];
125
122
126
123
NSMutableSet *callbacks = [NSMutableSet setWithCapacity: 1 ];
127
124
@synchronized (self.blockSet ) {
128
125
[callbacks setSet: self .blockSet];
129
126
[self .blockSet removeAllObjects ];
130
127
}
131
- for (void (^block)(CLLocation *, NSError *) in callbacks) {
132
- block (newLocation , nil );
128
+ for (PFLocationManagerLocationUpdateBlock block in callbacks) {
129
+ block (location , nil );
133
130
}
134
131
}
135
- #pragma clang diagnostic pop
136
-
137
- - (void )locationManager : (CLLocationManager *)manager didUpdateLocations : (NSArray *)locations {
138
- CLLocation *location = [locations lastObject ];
139
- CLLocation *oldLocation = [locations count ] > 1 ? [locations objectAtIndex: [locations count ] - 2 ] : nil ;
140
-
141
- // TODO: (nlutsenko) Remove usage of this method, when we drop support for OSX 10.8 (didUpdateLocations is 10.9+)
142
- #pragma clang diagnostic push
143
- #pragma clang diagnostic ignored "-Wdeprecated-declarations"
144
- [self locationManager: manager didUpdateToLocation: location fromLocation: oldLocation];
145
- #pragma clang diagnostic pop
146
- }
147
132
148
133
- (void )locationManager : (CLLocationManager *)manager didFailWithError : (NSError *)error {
149
134
[manager stopUpdatingLocation ];
0 commit comments