Skip to content

11.2 以后 使用了textField的地方就报泄漏 #89

Open
@zb1006801184

Description

@zb1006801184

11.2 以后 使用了textField的地方就报泄漏 ,这什么情况,有一样情况的嘛

Activity

billding211

billding211 commented on Mar 5, 2018

@billding211
    if #available(iOS 11.2, *)
    {
        let keyPath = "textContentView.provider"
        if self.window != nil {
            let provider = self.value(forKeyPath: keyPath)
            if provider == nil {
                self.setValue(self, forKeyPath: keyPath)
            }
        }else{
            self.setValue(nil, forKeyPath: keyPath)
        }
    }

https://www.jianshu.com/p/5add8d20f8a1?from=timeline&isappinstalled=0
可以解决.

xlsd

xlsd commented on Mar 21, 2018

@xlsd

这样虽然能解决,但是,给业务代码带来了风险,得不偿失。

liuchunlao

liuchunlao commented on Apr 12, 2018

@liuchunlao

push过去有三个文本框后,如果不点击文本框,,会释放3次。一切ok
然后如果点击后,就算不编辑内容,返回的时候就会报泄露了。。
登录跳转注册,然后返回时就出现了。

liuchunlao

liuchunlao commented on Apr 12, 2018

@liuchunlao

再次push时,又会提示大家都释放了。

AgoniNemo

AgoniNemo commented on May 3, 2018

@AgoniNemo

现在有更好的解决方案吗?这个也看过了issues,最后一个回复里,可以看到有一个比较好的方案,但是要引入两个库,感觉有点重

miniLV

miniLV commented on Jun 11, 2018

@miniLV

其实控制器还是会被dealloc,通过Debug Memory Graph查看该控制器是释放的, 但是alert 会弹出,提示retain cycle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @liuchunlao@AgoniNemo@billding211@xlsd@miniLV

        Issue actions

          11.2 以后 使用了textField的地方就报泄漏 · Issue #89 · Tencent/MLeaksFinder