Increasing object allocations, While checking object allocations in the Instruments
- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation
{
MKPinAnnotationView *annView = nil;
annView=[[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"currentloc"]autorelease];
for(int i=0;i<[List count];i++)
{
Small *Obj=[List objectAtIndex:i];
if([[annView.annotation title] isEqualToString:Obj.streetAddress])
{
annView.animatesDrop=TRUE;
annView.canShowCallout = YES;
annView.calloutOffset = CGPointMake(-5, 5);
开发者_如何学运维annView.rightCalloutAccessoryView=[UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[annView setPinColor:MKPinAnnotationColorGreen];
}
}
return annView;
}
The problem is that when you use Instruments to look at object allocations, this is only valid if you have switched off Zombie setting in the Schema related to the target. This is because Zombies will turn any released object into a Zombie instead of releasing it.
精彩评论