Prosecuting sergeant John Somerfield, of Dunedin, said police were called to Gorge Rd about 6.45pm after reports McCormack and an associate, both of whom had been drinking, were yelling at and abusing pedestrians. McCormack was "highly agitated".
When police arrived he continued to hurl abuse and then "stormed" towards the patrol car.
Police attempted to find out why he was so agitated, but he refused to talk to them, instead continuing to shout and swear.
When he tried to confront a member of the public he was arrested, but his behaviour escalated at the Queenstown police station. He later had no explanation.
Judge Farnan sentenced him to 40 hours' community work and ordered him to pay $59.80, the cost of the commercial cleaning for the cell he used as a bathroom.