增加对象分配,同时检查仪器中的对象分配

时间:2010-02-11 09:35:53

标签: objective-c

- (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;
}

1 个答案:

答案 0 :(得分:0)

问题在于,当您使用Instruments查看对象分配时,这仅在您关闭与目标相关的Schema中的Zombie设置时才有效。这是因为Zombies会将任何已释放的物体变成僵尸而不是释放它。