CImageView* CImageView::create(const char *pszFileName) { CImageView *pobSprite = new CImageView(); if (pobSprite && pobSprite->initWithFile(pszFileName)) { pobSprite->autorelease(); return pobSprite; } CC_SAFE_DELETE(pobSprite); return NULL; }
CImageView* CImageView::create(const char *pszFileName, const CCRect& rect) { CImageView *pobSprite = new CImageView(); if (pobSprite && pobSprite->initWithFile(pszFileName, rect)) { pobSprite->setTouchEnabled(false); pobSprite->autorelease(); return pobSprite; } CC_SAFE_DELETE(pobSprite); return NULL; }