Code Monkey home page Code Monkey logo

Comments (5)

tianzhuo112 avatar tianzhuo112 commented on September 27, 2024

你好,请问页面是否有重用的情况,也就是说是否有调用方法dequeueReusablePageWithIdentifier:?请确保页面的初始化符合demo中的规范,我们项目中有多重VTMagic嵌套,设计更加复杂,仍能很好地控制内存,或者你可以用instruments跟踪一下内存开销出在哪个地方。此外,在有大量数据的情况下,我们应该尽可能从数据库中读取缓存数据(比如页面重用时),而不是直接全部保存到内存中。

from vtmagic.

977616908 avatar 977616908 commented on September 27, 2024

您好,谢谢您的回复。dequeueReusablePageWithIdentifier用了。框架中一进入就加载了所有页面的数据,VTMagic是否有方法控制滑动后再加载,滑到的页面呢

from vtmagic.

tianzhuo112 avatar tianzhuo112 commented on September 27, 2024

你好,子控制器中的viewDidAppear:等方法对你应该有用,其调用逻辑与系统一致,viewDidAppear:在页面真正显示时触发,viewWillDisappear:在页面即将消失时触发,另外两个方法可依此类推。此外,vtm_prepareForReuse方法会在页面被重用时触发,你或许需要在这里修正一下页面偏移或者清除一下旧数据。demo中用的是假数据,所以在viewDidLoad方法中完成的数据加载,最近几天我会完善一下demo中的示例,以供大家参考。

from vtmagic.

977616908 avatar 977616908 commented on September 27, 2024

好的,再次感谢!找到原因了,不知道是不是本质原因。API接口返回了3图的cell时,每张gif图片的大小都在2M中,当我把图片改为100k内,内存突然降到24M中。cell上传的图片对加载和读取,这么占用内存啊?

from vtmagic.

tianzhuo112 avatar tianzhuo112 commented on September 27, 2024

gif图通常由多张图片合成,所以占用内存一般会比较大-_-!!

from vtmagic.

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.