我正在使用一个数组在 UIPageViewController 上添加一些 viewController。问题是当您进一步滑动时它们会留在内存中,我想删除它们。我找到了这个委托方法:
- (void)pageViewController:(UIPageViewController *)pvc didFinishAnimating:(BOOL)finished previousViewControllers:(NSArray *)previousViewControllers transitionCompleted:(BOOL)completed
{
// If the page did not turn
if (!completed)
{
return;
}
// This is where I want to delete the previousViewControllers to release memory
}
但是如何删除那些previousViewControllers?如果您向后滚动,它们需要重新加载,但我需要删除它们,否则它们会一直留在内存中。