导航控制器发布崩溃应用程序
我在 navigationController 中发布时遇到问题。我有一个带有点的地图视图。当我单击地图点时,我创建带有详细信息的新的detailViewController。一切正常,但是当我按下后退按钮时,我的应用程序返回到地图控制器,然后崩溃。如果我评论发布一切正常,但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];
I have a problem with release in navigationController. I have a map view with points. When I click on map point I create new detailViewController with detail. Everything works fine, but when I press back button my app back to the mapController and then crash. If I comment release everything works fine, but mapController is not release.
Here is my code:
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];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解除分配时,FavoriteDetailViewController 中的某些内容会崩溃。仔细看看dealloc方法。还要确保将FavoriteViewController 设置并委托为零。
Something in FavoriteDetailViewController is crashing when it is deallocated. Look carefully at the dealloc method. Also make sure you set and delegates of the FavoriteViewController to nil.