Xcode outputs the Error "Expected ‘)’ for the Identifier constructor and then says myNodeType is unknown ( which makes sense when the Identifier construction doesn’t work).
When you declare members in the class declaration, you don’t call the constructor but supply default arguments in form of an initialiser list.
It should work if you use {} instead.
N.B. these default argument will be ignored, if the constructor of the member is called in the implementation.
thanks for the fast reply! I’m a beginner with c++ so this tip is worth gold (maybe this could be added somewhere, for other “newbies” like me? Or maybe it is common knowledge I just never knew).
Moving the code into the constructor works fine!
Using the {} works in the declaration aswell, thank you! So my question is, where is the place this snippet from the tutorial is supposed to be? Maybe this context could be given in the tutorial for beginners like me to avoid this problem?
My thinking was “since I want this static thing to always be there, I define it right at the start in the declaration so I can use it everywhere then”.