resignFirstResponder 和校对者/PRDBinit 16 字节泄漏?

发布于 2024-11-16 21:54:56 字数 646 浏览 5 评论 0原文

我们在处理烦人的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

神仙妹妹 2024-11-23 21:54:56

通过购买新 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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文