这是我的Block类
#include"Blocks.h"
bool Block::init()
{
Sprite::create();
Size s=Size(40,60);
log("size=%d-%d",s.width,s.height);
this->setContentSize(s);
this->setTextureRect(Rect(0,0,40,60));
this->setAnchorPoint(Point(0,0));
this->setColor(Color3B::YELLOW);
return true;
}
Block* Block::create()
{
Block *b=new Block;
if(b->init())
{
b->autorelease();
return b;
}
}
下面是在HelloWrld里面使用的代码
Block *b=Block::create();
b->setPosition(Vec2(visibleSize.width/2,visibleSize.height/2));
this->addChild(b);
调试显示的是这里有问题,无法访问到内存
然后就是定位在了这里
请问大佬们这个怎么解决啊,是不是我哪里写错了