Moth balls are toxic. Other solutions include the following:
Mix the following together and sprinkle where ever you wish to repel cats. Reapply after rain.
2 parts cayenne pepper
3 parts dry mustard
5 parts flour
Any citrus peel on top of the soil will repel cats. Things that keep them from digging such as pine cones, aluminum foil, screen, stones, etc will also keep them from going potty in your pots. ;)