我在navigationController中发布了一个问题。我有一个带点的地图视图。当我点击地图点时,我创建了具有细节的新detailViewController。一切正常,但当我按回按钮我的应用程序回到mapController,然后崩溃。如果我发表评论发布一切正常,但mapController不会发布。 这是我的代码:
FavoriteDetailViewController *detailViewController = [[FavoriteDetailViewController alloc]
initWithNibName:@"FavoriteDetailViewController" bundle:nil favoriteID:
[[(DisplayMapAnnotation*)view.annotation detailID] intValue] favoriteName:
[(DisplayMapAnnotation*)view.annotation title] favoriteCompany:
[(DisplayMapAnnotation*)view.annotation subtitle] favoriteLocation:
[(DisplayMapAnnotation*)view.annotation detailLocation] favoriteHtmlString:nil
favoriteJobIndex:0 favoriteTotalJobs:1 favoriteGeoLat:detailArrayData.geoLat
favoriteGeoLng:detailArrayData.geoLng favoriteFullUrl:detailArrayData.fullUrl
favoriteExportUrl:detailArrayData.exportUrl favoriteIdent:1];
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
答案 0 :(得分:0)
当FavoriteDetailViewController被取消分配时,它会崩溃。仔细看看dealloc方法。还要确保将FavoriteViewController的设置和委托设置为nil。