TextField* TextField::create() { TextField* widget = new TextField(); if (widget && widget->init()) { widget->autorelease(); return widget; } CC_SAFE_DELETE(widget); return NULL; }
TextField* TextField::create() { TextField* widget = new (std::nothrow) TextField(); if (widget && widget->init()) { widget->autorelease(); return widget; } CC_SAFE_DELETE(widget); return nullptr; }
TextField* TextField::create() { TextField* widget = new TextField(); if (widget && widget->init()) { CC_SAFE_AUTORELEASE(widget); return widget; } CC_SAFE_DELETE(widget); return NULL; }
TextField* TextField::create(const std::string &placeholder, const std::string &fontName, int fontSize) { TextField* widget = new (std::nothrow) TextField(); if (widget && widget->init()) { widget->setFontName(fontName); widget->setFontSize(fontSize); widget->setPlaceHolder(placeholder); widget->autorelease(); return widget; } CC_SAFE_DELETE(widget); return nullptr; }