我的應用程序崩潰,消息「...發送到解除分配的實例的地址...」。所以,我用殭屍工具分析了應用程序,並在下面提供了導致崩潰的代碼片段。 我還沒有找到導致此錯誤的場景。發送到釋放實例的消息 - 使用殭屍進行分析
(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%;
有誰知道可能是什麼問題?
我針對的應用程序低於5.0,所以我不能使用ARC,對吧? – dorin 2012-08-13 10:06:21
@Dorin ARC適用於iOS 4.0+。您只需使用其中一個最新的Xcode版本即可使用此功能。 – 2012-08-13 10:07:13