开发者

iPhone: ViewController ends up badly after simulating memory warning

开发者 https://www.devze.com 2023-03-01 02:06 出处:网络
I have a view controller HomeViewController which shows some grids. Once I go to an inner view controll开发者_开发知识库er by clicking on a grid, I do a \"Simulate memory warning\" in the Simulator me

I have a view controller HomeViewController which shows some grids. Once I go to an inner view controll开发者_开发知识库er by clicking on a grid, I do a "Simulate memory warning" in the Simulator menu. Now, when I press back button go back to HomeViewController, the grids become bare - white in colour.

Any idea why this is happening ? Any suggestions on how to debug this?

Some more details: The HomeViewController view is itself loads from a NIB. Each of the grid (GridView) loads separately from a Grid.xib.


The HomeViewController will unload its view when it receives a memory warning while its view is not visible. Make sure you reload everything viewDidLoad that gets unloaded when the view is released. Also, your views must not hold any state on their own; you must be able to reconstruct every view with the data you hold in your model and controller objects.

0

精彩评论

暂无评论...
验证码 换一张
取 消