gpt4 book ai didi

xcode - UIButton 点击​​获取 [SecondPage performSelector :withObject:withObject:]: message sent to deallocated instance

转载 作者:行者123 更新时间:2023-12-04 01:31:07 28 4
gpt4 key购买 nike

通过使用 Xcode 5 并启用自动引用计数。

在基于非 NavigationController 的应用程序中,我使用了一个 UIButton,并且正确定义和连接了 IBAction 和 IBOutlet。但在 IBAction 由 Button 调用的 TouchUpInside 事件之前,应用程序给出了“[SecondPage performSelector:withObject:withObject:]: message sent to deallocated instance 0x6cb7970”。
SecondPage 是此 UIButton 所在的 View Controller 。

基本上我想在这个 UIButton 上打开一个新的 View Controller 的 View ,我将通过自定义 Segue 来做到这一点

最佳答案

嗯,听起来很奇怪,ARC 会在调用选择器之前自动释放您的 secondView Controller 。

尝试将您的 secondView 定义为第一个的属性(如果您将其添加为 subview ),属性类型为 strong。

这就是我可以在没有看到您的代码的情况下推荐的内容。

关于xcode - UIButton 点击​​获取 [SecondPage performSelector :withObject:withObject:]: message sent to deallocated instance,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8723511/

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