开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜