gpt4 book ai didi

ios - -[UIViewControllerWrapperView 框架] : message sent to deallocated instance getting Crash in IOS7

转载 作者:可可西里 更新时间:2023-11-01 06:10:19 26 4
gpt4 key购买 nike

我的项目是为 IOS5 和 6 制作的。在 IOS7 发布后,我们也在为 IOS7 升级我们的项目。但我在 IOS7 中面临一个问题。

当我第一次在 IOS7 模拟器中安装我的应用程序时,它会崩溃并显示以下消息。

*** -[UIViewControllerWrapperView frame]: message sent to deallocate

但在 IOS7 以下它工作正常。谢谢

最佳答案

OS 7 确实更改了一些有关 TableView 及其委托(delegate)的规则。当然,这不会在容易找到的地方突出显示。

但基本上,在早期版本的 iOS 中,您可以选择性地取消 tableView 委托(delegate)和数据源。不这样做不会发送任何错误消息。

从 iOS 7 开始,您必须在 dealloc 中将它们置零,否则会导致崩溃。

- (void)dealloc
{
fetchedResultsController.delegate = nil;
self.searchDisplayController.delegate = nil;
self.searchDisplayController.searchResultsDelegate = nil;
self.searchDisplayController.searchResultsDataSource = nil;
self.tableView.delegate = nil;
self.tableView.dataSource = nil;
}

如果这解决了您的问题,请告诉我。

关于ios - -[UIViewControllerWrapperView 框架] : message sent to deallocated instance getting Crash in IOS7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18074109/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com