Code Monkey home page Code Monkey logo

Comments (10)

qq826075241 avatar qq826075241 commented on July 17, 2024

请问内存泄漏的问题你是怎么解决的?

from yykline.

xiaozhenyangCode avatar xiaozhenyangCode commented on July 17, 2024

把转换 Y_KLineModel 放在了Y_KLineGroupModel.m 里面

from yykline.

qq826075241 avatar qq826075241 commented on July 17, 2024

感谢回复,我是在Y_KLineGroupModel里加了copy方法,也解决了这个问题

from yykline.

xiaozhenyangCode avatar xiaozhenyangCode commented on July 17, 2024

copy???

from yykline.

qq826075241 avatar qq826075241 commented on July 17, 2024

就是拷贝了Y_KLineGroupModel对象再赋到Y_KLineModel中处理,防止出现循环引用

from yykline.

wiilsliang avatar wiilsliang commented on July 17, 2024

copy???

能不能具体贴下代码?谢谢了

from yykline.

wiilsliang avatar wiilsliang commented on July 17, 2024

就是拷贝了Y_KLineGroupModel对象再赋到Y_KLineModel中处理,防止出现循环引用

能不能贴下代码?谢谢了

from yykline.

zhanghuanProgrammer avatar zhanghuanProgrammer commented on July 17, 2024

/**

  • 前一个Model
    */
    @Property (nonatomic, strong) Y_KLineModel *PreviousKlineModel;

/**

  • 父ModelArray:用来给当前Model索引到Parent数组
    */
    @Property (nonatomic, strong) Y_KLineGroupModel *ParentGroupModel;

把上面的strong改成weak , 保证不会再内存泄漏,我找了3个小时才排除这个问题,作者在这里大意了,指向前一个model和父model,怎么能用strong了,这样导致互相引用,不能释放内存呀

from yykline.

xinle13 avatar xinle13 commented on July 17, 2024

@Property (nonatomic, copy) NSNumber * 这里的NSNumber的属性用strong吧,copy也会内存泄露

from yykline.

WillkYang avatar WillkYang commented on July 17, 2024

fixed.

from yykline.

Related Issues (20)

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.