Call function attachWithIME crash

hi all,i create a CCTextFieldTTF in my hello world project,code as bellow:

CCTextFieldTTF* test = CCTextFieldTTF::textFieldWithPlaceHolder(“InputHere”,“Thonburi”,50);
test~~>attachWithIME;
addChild;
when program go to test~~>attachWithIME(); it will crash and error is access voilation.

but when i paste up codes to testCpp project,it will works.Why?

Please help me,thanks.


error.jpg (32.5 KB)

My develope environment is VS2010,