开发者

Increasing object allocations, While checking object allocations in the Instruments

开发者 https://www.devze.com 2022-12-20 01:15 出处:网络
- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation
- (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

精彩评论

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

关注公众号