如何检验一个文件是否正确的图片文件!

CCSprite* spr= CCSprite::spriteWithFile(“XX.xxx”);
if(NULL!=spr){
return true ;
}

这种写法有点2,有没省点的方法??

CC_BREAK_IF(!spr);

那个写法挺好的啊,能在里面下断点,代码也要写得方便调试。

CC_BREAK_IF(!spr);