Coder Social home page Coder Social logo

Comments (11)

Jinxiansen avatar Jinxiansen commented on August 22, 2024

你好,可否提供这个Demo与我了解一下。

from jhud.

xeroCBW avatar xeroCBW commented on August 22, 2024

你在第二个 item 进去-->next-->touch一下-->马上 pop 回去,就会看到内存泄露的弹框
CBWEmptyViewDemo副本.zip

from jhud.

Jinxiansen avatar Jinxiansen commented on August 22, 2024

我看了下,定时器在没有调用hide方法就返回而导致,应该是类方法中的objc函数可能导致,
暂时没有更好的办法,建议使用实例方法。😂

from jhud.

xeroCBW avatar xeroCBW commented on August 22, 2024

其实这个是objc_setAssociatedObject的OBJC_ASSOCIATION_RETAIN_NONATOMIC导致的,但是您的换成OBJC_ASSOCIATION_ASSIGN会崩溃

from jhud.

Jinxiansen avatar Jinxiansen commented on August 22, 2024

Yeah ,这个我有测试过,所以现在迫于所学有限,不好下手啊。😂

from jhud.

xeroCBW avatar xeroCBW commented on August 22, 2024

根据WWDC 2011, Session 322 (第36分钟左右)发布的内存销毁时间表,被关联的对象在生命周期内要比对象本身释放的晚很多。它们会在被 NSObject -dealloc 调用的 object_dispose() 方法中释放。

看下这个
http://nshipster.cn/associated-objects/

from jhud.

Jinxiansen avatar Jinxiansen commented on August 22, 2024

🙂 好。
道友可以先尝试JHUD.m中注掉 的 hideForView:(UIView *)view 方法来隐藏。

from jhud.

Jinxiansen avatar Jinxiansen commented on August 22, 2024

如上所言,我参考了MBProgressHUD,移除了OBJC相关方法,使用+hideForView:(UIView *)view来实现隐藏的目的。
已更新JHUD。

from jhud.

ZenonHuang avatar ZenonHuang commented on August 22, 2024

@xeroxmx 学习了一波,兄弟能提供下内存泄露的一些解决方法吗?目前使用MLeaksFinder,有时就算知道哪里出了问题,也有些无从下手的感觉,不知道如何修改

from jhud.

xeroCBW avatar xeroCBW commented on August 22, 2024

@zzgo 也苦恼于内存泄露的代码在哪里, MLeaksFinder只会显示类,不会显示具体的哪一些代码内存,上次遇到 SEL 作为属性用 strong,结果内存泄漏了,找了半天才找到,要用 weak

from jhud.

Jinxiansen avatar Jinxiansen commented on August 22, 2024

😂

from jhud.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.