Closed cityleaf closed 6 years ago
APP进入后台,再回到前台,除了当前显示的子页面,缓存的其他子页面都被清除;回到前台后,清除的子页面又被重新初始化创建,之前的数据及UI不复存在。有没有什么办法可以规避进入后台缓存被清除的问题,看了您的源码,用的是系统的NSCache,它会自动清除缓存。
如果想用永久缓存 可以设置prefetchItemCount 为比加大的值, 或者自己强引用childcontrollers
APP进入后台,再回到前台,除了当前显示的子页面,缓存的其他子页面都被清除;回到前台后,清除的子页面又被重新初始化创建,之前的数据及UI不复存在。有没有什么办法可以规避进入后台缓存被清除的问题,看了您的源码,用的是系统的NSCache,它会自动清除缓存。