我的应用程序崩溃并显示消息“...发送到地址...的已释放实例”。因此,我使用僵尸工具分析了该应用程序,并在下面展示了导致崩溃的代码片段。我还没有找到导致这个错误的场景。
(void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
{
if ([view.annotation isKindOfClass:[MKUserLocation class]]) {
}
else {
CustomAnnotation *ann = (CustomAnnotation *) view.annotation;
if (ann.annotationType == BusAnnotationType) {
NSLog(@"accessory button tapped for annotation %@", view.annotation);
BusInfoViewController *viewController = [[BusInfoViewController alloc] initWithNibName:@"BusInfoViewController" bundle:nil];
BusForStation *bus = [self getBusWithId:[(CustomAnnotation *)view.annotation ID]];
viewController.currentBus = bus;
[self.navigationController pushViewController:viewController animated:YES];
[viewController release];
}
}
分析器工具在 [self.navigationController pushViewController:viewController animated:YES] 行获得 91.4%;
有谁知道可能是什么问题?