12207480 / TYPagerController

page scroll view and controller,simple,high custom,and have many tabBar styles,,support Objective-C and swift
MIT License
1.37k stars 232 forks source link

APP进入后台,再回到前台,缓存的页面被自动清除 #115

Closed cityleaf closed 6 years ago

cityleaf commented 6 years ago

APP进入后台,再回到前台,除了当前显示的子页面,缓存的其他子页面都被清除;回到前台后,清除的子页面又被重新初始化创建,之前的数据及UI不复存在。有没有什么办法可以规避进入后台缓存被清除的问题,看了您的源码,用的是系统的NSCache,它会自动清除缓存。

12207480 commented 6 years ago

如果想用永久缓存 可以设置prefetchItemCount 为比加大的值, 或者自己强引用childcontrollers