几年没撸了,朋友说cocoscreator现在根unity一样,于是玩了下,结果。。。
onLoad () {
netControl.connect();
this.sceneLogin = cc.instantiate(this.preLogin);
//this.sceneLogin.active = true;
this.node.addChild(this.sceneLogin);
this.sceneRegister = cc.instantiate(this.preRegister);
//this.sceneRegister.active = false;
this.node.addChild(this.sceneRegister);
},
为什么注释了两行,就可以跑,打开注释,无数条这个错误:Simulator: E/jswrapper (271): ERROR: Uncaught TypeError: Cannot read property ‘length’ of null, location: src/cocos2d-jsb.js:0:0