diff --git a/cocos/ui/UIPageView.cpp b/cocos/ui/UIPageView.cpp index f882663a59..0d2f42011f 100644 --- a/cocos/ui/UIPageView.cpp +++ b/cocos/ui/UIPageView.cpp @@ -181,7 +181,7 @@ void PageView::removePageAtIndex(ssize_t index) void PageView::removeAllPages() { - for(auto& node : _pages) + for(const auto& node : _pages) { removeProtectedChild(node); }