static TestCustomTableView* create(TableViewDataSource* dataSource, Size size) { auto table = new (std::nothrow) TestCustomTableView(); table->initWithViewSize(size, nullptr); table->autorelease(); table->setDataSource(dataSource); table->_updateCellPositions(); table->_updateContentSize(); return table; }
GridView* GridView::create(const Size& size, Node* container) { auto gridView = new (std::nothrow) GridView(); if (gridView && gridView->initWithViewSize(size, container)) { gridView->autorelease(); return gridView; } CC_SAFE_DELETE(gridView); return nullptr; }