- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
通过使用 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/
这个问题在这里已经有了答案: performSelector may cause a leak because its selector is unknown (19 个回答) 关闭 9 年前。
使用此语句会立即调用选择器,而不是从现在开始 6 秒。 this.PerformSelector(myStartWaitForSoundSelector, null, 6.0f); 有谁知道如何让它延
如果我用这个开始做某事: > [self performSelector:@selector(runThis:) > withObject:thisObject > afterDelay
虽然它在模拟器上似乎不会造成问题,但在设备上使用 performSelectorInBackground 会导致内存泄漏。或者至少 Instruments 是这么表示的。查看代码我没有任何线索可能是什
我有一个包含多个部分的 UITableView。每个部分包含一组不同的数据:电话号码、地址.... 对于这些集合中的每一个,我都有一个模型:PhoneNumber、Address。它们完全不同,但有一
我知道这两者有点相似,但两者之间肯定有任何内在差异, [anObject performSelector:@selector(thisMethod:) withObject:passedObject]
我想做performSelector:withObject:,但对象是CGFloat。所以它实际上不是一个对象。我怎样才能做到这一点? 我正在执行选择器的对象不是我的,我无法修改它。 例如 [xyz
我正在搞乱一些线程。现在考虑一下:我有一个主线程。我开始一个新线程。在它的入口点方法中,我想创建一个运行循环。现在文档告诉我我必须有一个输入源。否则我的运行循环会立即退出。坏的。好的。但除了我的 Pe
我想执行有几个参数的方法。有什么简单的方法可以一次通过其中的几个吗?有点像 [self performSelector:@selector(methodName) withObject:firstPa
我想执行有几个参数的方法。有什么简单的方法可以一次通过其中的几个吗?有点像 [self performSelector:@selector(methodName) withObject:firstPa
为了进行调试,我需要从一段代码中调用CGFloat访问器方法,该代码根据iVar的名称生成选择器。 - (CGFloat) myIVar { return myIVar; } 设置者具有以下形
我有一个自定义 BackBarButton,我有一个属性来存储在某些情况下可以更改的选择器。所以我不能很顺利地使用委托(delegate)。 在不将“工作流程”更改为委派的情况下,我该怎么做才能消除此
我收到 ARC 编译器的以下警告: "performSelector may cause a leak because its selector is unknown". 这就是我正在做的事情: [_
这可能是一个幼稚的问题,但我还是会问这个问题,因为我找不到任何文档来解决我脑海中的这个问题。 我使用 Xcode45-DP4 在设备和模拟器中运行 iOS5.1。 我有一个循环遍历一个类的多个实例的数
我在这段代码中使用 performSelector 方法时遇到了一些问题: 这个方法在另一个名为“JSONMethods”的类中: +(void)sendPostMsgWithMultipleArgu
背景:我有一个代表与服务器连接的对象(我们称之为 BackendClient)。它的方法生成为单个 @protocol 并且它们都是同步的,所以我想创建将在后台调用它们的代理对象。主要问题是返回值,我
我熟悉此 ARC 警告 ( performSelector may cause a leak because its selector is unknown ) 的解决方案,并在大多数情况下实现了它们
这行代码完美运行 [self explodeBomb:obj]; 但是如果我用下面的行替换它,我会得到一个 NSInvalidArgument 异常,原因是无法识别的选择器。 [self perfo
我在另一个类中有一个方法,我这样调用这个方法 [captureView performSelector:@selector(startRecording) withObject:nil afterDe
是否可以使用此方法并传递一个对象?使用此代码,我收到此错误: -[myApp hideUpdateView]: unrecognized selector sent to instance 0x8b6
我是一名优秀的程序员,十分优秀!