Permalink
Browse files

Merge pull request #6 from interlock/master

Conditional ARC support
  • Loading branch information...
2 parents 429f99a + ef0af14 commit f24a90d4c98198e7828966496500c95bc1a7bed2 @RVLVR committed Mar 18, 2012
@@ -44,10 +44,11 @@ - (NSUInteger) count
return [collection count];
}
-
+#if !__has_feature(objc_arc)
-(void)dealloc
{
[collection release], collection = nil;
[super dealloc];
}
+#endif
@end
@@ -40,8 +40,11 @@ - (void) addAnnotation:(id<MKAnnotation>)annotation
double y = [annotationsCollection ySum] / [annotationsCollection count];
CLLocationCoordinate2D location = MKCoordinateForMapPoint(MKMapPointMake(x, y));
-
+ #if !__has_feature(objc_arc)
REVClusterPin *pin = [[[REVClusterPin alloc] init] autorelease];
+#else
+ REVClusterPin *pin = [[REVClusterPin alloc] init];
+#endif
pin.coordinate = location;
pin.nodes = [annotationsCollection collection];
return pin;
@@ -60,10 +63,12 @@ - (NSString*) description
return [NSString stringWithFormat:@"%i annotations",[self count]];
}
+#if !__has_feature(objc_arc)
- (void) dealloc
{
[annotationsCollection release], annotationsCollection = nil;
[super dealloc];
}
+#endif
@end
@@ -63,7 +63,9 @@ + (NSArray *) clusterAnnotationsForMapView:(MKMapView *)mapView forAnnotations:(
{
REVClusterBlock *block = [[REVClusterBlock alloc] init];
[clusteredBlocks addObject:block];
+ #if !__has_feature(objc_arc)
[block release];
+#endif
}
for (REVClusterPin *pin in visibleAnnotations)
@@ -56,11 +56,13 @@ - (void) setup
zoomLevel = self.visibleMapRect.size.width * self.visibleMapRect.size.height;
}
+#if !__has_feature(objc_arc)
- (void)dealloc
{
[annotationsCopy release];
[super dealloc];
}
+#endif
-(MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id <MKOverlay>)overlay
{
@@ -221,7 +223,9 @@ - (BOOL) mapViewDidZoom
- (void) addAnnotations:(NSArray *)annotations
{
+ #if !__has_feature(objc_arc)
[annotationsCopy release];
+#endif
annotationsCopy = [annotations copy];
NSArray *add = [REVClusterManager clusterAnnotationsForMapView:self forAnnotations:annotations blocks:self.blocks minClusterLevel:self.minimumClusterLevel];
@@ -22,11 +22,14 @@ - (NSUInteger) nodeCount
return 0;
}
+#if !__has_feature(objc_arc)
- (void)dealloc
{
[title release];
[subtitle release];
[nodes release];
[super dealloc];
}
+#endif
+
@end

0 comments on commit f24a90d

Please sign in to comment.