The error is you are trying to use the -> operator of the class but it should be of the object.

CategoryType is a class and its objects / pointers like *newCat, *currentCat, *prevCat should be used here