iPhone Development - Lessons in memory management

前端 未结 5 1764
既然无缘
既然无缘 2021-02-04 15:47

I need lessons in memory management. I have an application that uses multiple views (around 10), some of these are attached to tab controller. Problem is that I\'m using images

5条回答
  •  伪装坚强ぢ
    2021-02-04 16:24

    The UITableView has a way to reuse table cells that aren't being displayed anymore. That way if you only display 6 cells on the screen at once it doesn't keep on creating more as you scroll, but reuses the cells that have gone off screen. whenever you want to create a new cell, first query the tableview to see if it has any to reuse and if not then create a new one.

    an example of this can be found on slide 55 of the standford iphone course note found here: http://www.scribd.com/doc/7671058/Standford-CS-193P-11Performance

提交回复
热议问题