Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Conditional ARC support #6

Merged
merged 1 commit into from

2 participants

@interlock

I've added some simple macros to add conditional arc support. This makes it easier to reference the REVClusterMap directory in a project and continue to pull in updates if required.

@RVLVR RVLVR merged commit f24a90d into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 17, 2012
  1. @interlock

    arc support

    interlock authored
This page is out of date. Refresh to see the latest.
View
3  REVClusterMap/REVClusterMap/REVAnnotationsCollection.m
@@ -44,10 +44,11 @@ - (NSUInteger) count
return [collection count];
}
-
+#if !__has_feature(objc_arc)
-(void)dealloc
{
[collection release], collection = nil;
[super dealloc];
}
+#endif
@end
View
7 REVClusterMap/REVClusterMap/REVClusterBlock.m
@@ -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
View
2  REVClusterMap/REVClusterMap/REVClusterManager.m
@@ -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)
View
4 REVClusterMap/REVClusterMap/REVClusterMapView.m
@@ -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];
View
3  REVClusterMap/REVClusterMap/REVClusterPin.m
@@ -22,6 +22,7 @@ - (NSUInteger) nodeCount
return 0;
}
+#if !__has_feature(objc_arc)
- (void)dealloc
{
[title release];
@@ -29,4 +30,6 @@ - (void)dealloc
[nodes release];
[super dealloc];
}
+#endif
+
@end
Something went wrong with that request. Please try again.