resignFirstResponder 和校对者/PRDBinit 16 字节泄漏?
我们在处理烦人的 iPhone 键盘时遇到了一个小问题。
我们已经尝试
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[oneTextField resignFirstResponder]; // 100% leak for 16 bytes
// some more textfields.
}
过使用
-(BOOL)textFieldShouldReturn:(UITextField *)textField{
[oneTextField resignFirstResponder]; // 100% leak for 16 bytes
// some more textfields.
return YES;
}
,但是无论我们这样做,我们都会遇到令人讨厌的 16 字节泄漏。这只会发生一次。在整个应用程序中仪器运行 30 分钟期间,我们得到的泄漏不超过 16 字节。
当您点击所有文本字段并点击背景/返回键后键盘消失时,就会发生泄漏。
现在我正在寻求帮助,因为这是我们当前项目中唯一剩下的内存泄漏,我们希望它得到解决。我是用黑手党的术语来说的。
We're having a minor issue dealing with the pesky iPhone keyboard.
We have tried
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[oneTextField resignFirstResponder]; // 100% leak for 16 bytes
// some more textfields.
}
and tried using
-(BOOL)textFieldShouldReturn:(UITextField *)textField{
[oneTextField resignFirstResponder]; // 100% leak for 16 bytes
// some more textfields.
return YES;
}
And however we do this, we get a pesky leak of 16 bytes. This ONLY happens once. We get no more than 16 bytes of leaks during a 30minute run with the instruments throughout the entire application.
The leak occurs when the keyboard dissapeares after you've tapped all of the textfields and tapping either the background/returnkey.
Now i'm calling out for a helping hand, since this is the only remaining memory leak that we have in our current project, and we want it taken care of. And i'm speaking in mafia terms.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过购买新 iPhone 解决了这个问题。对于那些也遇到过此类泄漏的人,我的一位同事表示,这是 100% 的误报。
快乐编码!
This issue was resolved by getting a new iPhone. For those of you that also has a leak such as this, one of my coworkers said that this is a 100% false-positive.
Happy coding!